Re: Images in PHP and MySQL
| From: | Gary Hotko | Date: | Thu, 07 Oct 2004 02:53:55 +0000 |
| Subject: | Re: Images in PHP and MySQL | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198790@lists.php.net to get a copy of this message | ||
No problem Ed thanks...
Actually I was supprised to see this conversation (thread) come back
into my GMAIL inbox....
On Wed, 6 Oct 2004 15:57:12 -0700, Ed Lazor <ed.lazor@d20news.com> wrote:
> > 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
>
>