At 11:07 PM +0200 5/11/06, Jochem Maas wrote:
I think you make interesting points Tedd, it's given me stuff to
think about anyway.
leveraging a Db for image storage can have advantages but
implementing it correctly
takes a stack more knowledge and more work to do it correctly,
therefore the recommendation
for those starting out in php should, I feel, remain 'use the
filesystem' - if only
because understanding and using the filesystem properly is one of
the foundations
of the craft. no?
For beginners, I would have to agree because, as you said, they
already have already been exposed to the concept of the "file system".
But, at some point (and I forgot to mention this in my previous post)
all programmers start thinking in collections of data and a dB
becomes a well suited solution (record holder and organizer) for
that. As such, all data connected to a record, including images, are
"better" suited if organized and saved in one place.
With regard to problems in display, speed, storage, and such -- those
are just the temporary growing pains of the industry and will pass.
Remember Gopher? The Internet has come a long way since then. I
suspect that in five-ten years, people will arguing "You still use
the file system for storing those?"
with regard to the refresh issues I believe this can be dealt with
by outputting
correct last-modified headers with the image data (which can also be
stored in the DB ;-)
Interesting -- but, I had problems with different browsers -- some
worked and some didn't. So, I resorted to the "file system" for the
storage for both thumbnail and normal size images. I was spending too
much time trying to fix it for all main browsers, so I took the
easy-way out. It works (I think) see:
http://ancientstones.com
At least I put it up for review in css and through BrowserCam.
with regard to increasing speed: what I often end up doing, mostly
because I allow
dynamic resizing of images (i.e. the thumbnail and the 'large' image come
from a single stored source) is to use a memory based cache where previously
outputted images are stored for as long as possible (i.e. until the
source changes
or the server is restarted or the cache is full or whatever).
I did the same thing including merging a copyright on the image. I
believe that saving all related data in a dB is really the "right"
way to go. From there, you can do anything you want with the data.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php