Hi, this is a follow up to a previous question that was already answered. I have a few images (out of over 1000) that are having this issue.
The images are stored in a MSSQL 2008 R2 database in image field types.
Here is the code I am using to retrieve and create the image file:
$imageblob = $rows['ProductPicture'];
$image = imagecreatefromstring($imageblob);
On the problem images, the following error is logged to system.log -
ERR (3): Notice: imagecreatefromstring() [<a href='function.imagecreate
ng</a>]: gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file
I have tested the image by saving it to the web server and using the following code:
$fileOut = "MageImages/test2.jpg";
$imagestring = file_get_contents($fileIn);
$image = imagecreatefromstring($imagestring);
I would love to be fix the problem but at the very least I need to find out a way to trap the error and notify the user.
Thanks for any help you can provide!