Re: Weird Image Problem

From: Date: Thu, 30 Jun 2005 20:34:09 +0000
Subject: Re: Weird Image Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-217909@lists.php.net to get a copy of this message
On Wed, June 29, 2005 3:30 pm, Shane Little said: > I'm bin2hex'ing images from an upload script and inserting into a mysql > blob field. The php script that re-packs the hex data back to binary, > does the createimagefromstring() and streams the image to the browser is > generating a corrupted image... i.e. The image looks fine until part-way > down... then... no more image; just a gray background where the rest of > the image should be. Seems to happen on image any larger than 30 or so > kilobytes. Anybody working the the php image libraries seen this before? Storing images inside MySQL is almost always a Bad Idea in the first place... I'll assume you know that, and have good reason to not use the super-fast, custom-optimized large-data software specifically designed to handle your images. * First, check that MySQL blob fields are not limited to 32K somehow. I suspect that they are. Next, one has to wonder why use bin2hex? Yes, it should generate only 0-9a-f characters, which are all valid for MySQL, but surely that is not the best way to do this... I don't store images in MySQL, so don't KNOW what is the best way, but I'm putting money down right now that bin2hex ain't the best way. * the super-fast, custom-optimized large-data software specifically designed to handle your images is known as... The File System. :-) -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#217909) next »