So, following on from here:
http://phpbuilder.com/board/showthread.php?&t=10372650
because we're moving away from that issue.
First, the question was asked as to why I don't want to store them on the file system and here are the reasons:
This site was originally a Ruby on Rails app and I'm converting it. For that reason all images are currently stored in the DB.
I'm linking the images to my articles and I'll need a thumbnail and a normal sized version. By keeping everything in the DB I minimise the chance of the physical files and the DB information getting out of step.
Backing up the site is much easier
To use the file system will mean CHMODing directories in the public folder which I consider a bit of a security issue. One of my sites had something 'living' on one such directory which disturbed me.
So, for each article I want to take the image, resize it to the maximum size needed for article output and also resize to create a thumbnail for the article's abstract, and then to write these out to the database.
Additionally I would like to be able to take a BMP file entered and convert to a JPG. Actually I'd like to do that with PNG files too. The reason for this is my user is not at all good with images. He doesn't understand the different types, nor how to convert them and he has a lot of work to do on the site anyway. At the moment there are several images he will upload as big PNG files or BMP files particularly that I then have to go through and change afterwards.
My issue with this is that the GD libraries don't seem to be well set up to give out the JPG data in a way I can store on the DB. It seems to only be direct output methods.
So:
- Is there a way to do what I'm doing?
- Am I wrong about the advantages of DB vs. file system?
- If the GD libraries are just not going to work with the DB and will need the filesystem, are there better ways to go about this?
Thanks in advance.