> On Friday 01 October 2004 05:52, Ed Lazor wrote:
> > Images take up more space when stored in the db, because you're storing
> raw
> > binary data.  Gif and jpeg are compression methods that convert binary
> data
> > into something smaller that can be stored in a file.
> 
> ??
> 
> If you store a jpeg file into a database blob, the database doesn't
> magically
> decompress the jpeg file. It will just treat the jpeg file as any other
> binary file and store it as-is (plus any overhead).

Sorry for not responding sooner - just found this message while cleaning on
my PHP folder.

Anyway, we're both right, depending on how you go about saving the images to
the database.  You're talking about using PHP's file functions to open the
image file, read in the data, and stream it to the database.  I'm talking
about using the built-in GD functions to grab the image (like
imagecreatefromjpeg) and store it into the database.

As you're pointing out, the GD functions are performing the compression and
decompression.

This was part of another discussion GH and I were having on the MySQL list
about different approaches to storing large collections of images.  Sorry, I
should have mentioned that.

-Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to