RE: Images in PHP and MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux