[PHP] Weird Image Problem
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? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Weird Image Problem
Kristen G. Thorson wrote: MySQL blobs are actually limited to 64K. I think a MEDIUMBLOB holds about 16 MB if you're dead-set on storing the image in the database. You might want to check that your max_allowed_packets size is large enough. You can find that by querying SHOW VARIABLES LIKE 'max_allowed_packet'; I just double-checked the manual. It does say that this needs to be set to the largest blob. kgt doh! That seems to have been the problem. I THOUGHT I had set the field up as a mediumblob or longblob turns out it was only a blob.. and you're right.. ~64k max I had already checked the MAX_ALLOWED_PACKET yesterday and bumped it up to 16M. Figures... I've been staring at the computer screen too long. Thanks for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php