PDA

View Full Version : Converting Db Images to Images



billbenson
11-05-2018, 07:39 PM
I have a MySQL database with images that I want to convert to regular images. Does anybody know of a php script that will convert these. Also, what is the preferred format for images these days. I come from a jpg era and I have a feeling other formats are preferred.

turboguy
11-05-2018, 10:28 PM
I can't answer the first part but as far as images go for web jpg is still popular. PNG has probably moved into second place. One of the pluses of PNG is that you can have transparency where you can't with jpg. GIF used to be the preferred way for transparency but they have fallen out of favor because of the limitations. GIF is still popular for animations.

Harold Mansfield
11-06-2018, 12:12 PM
Are there a lot of them?
How were they originally created?
Are they from a WordPress site?

Would an SQl query even work? Wouldn't you have to export the images out of the database to convert them, or else they would still be in the database and still formatted as such. Right?
Or are you trying to change their format within the database?

I'm not sure, I'm spitballing here.

billbenson
11-07-2018, 03:35 PM
They are in a a cart plugin on a wordpress site. There are thousands of images. They were created one by one adding to a cart from an admin panel. I haven't looked at this in a few years, but as I recall there is a php command to display code images.

Harold Mansfield
11-07-2018, 04:16 PM
They are in a a cart plugin on a wordpress site. There are thousands of images. They were created one by one adding to a cart from an admin panel. I haven't looked at this in a few years, but as I recall there is a php command to display code images.

They should still be in your WordPress media folder and you can just go right to that folder and download them as is.
Or the cart plug in may have created it's own media folder, but same method.

You don't need to even mess with the database, the images are on the server in a folder. With WordPress, all the database does is store the path of the images in relationship to the content and settings, not the actual images themselves.