Image upload - imagecreatefromjpeg errors 214, 118, 66.

awillustration / 2013-02-28 00:18:51   

So recently I've been unable to upload images (jpgs) due to a number of errors that keep popping up even though I've made no changes to any of my sheets. They look like this;

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in /home/alex/public_html/ndxz-studio/lib/media.php on line 214

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/home/alex/public_html/files/gimgs//39_cowboy-1000w.jpg' is not a valid JPEG file in /home/alex/public_html/ndxz-studio/lib/media.php on line 214

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/alex/public_html/ndxz-studio/lib/media.php on line 118

Warning: Cannot modify header information - headers already sent by (output started at /home/alex/public_html/ndxz-studio/lib/media.php:214) in /home/alex/public_html/ndxz-studio/lib/template.php on line 66

So far I've read bits and bobs but nothing concrete, is this something I have to change on my end or something the host addresses?

Many thanks,

Alex

Vaska A / 2013-02-28 00:21:59   

I've never seen that actual error message before. We've seen similar, but not the same...

I think something is wrong with your jpg file. Make sure it's a real jpg, RGB, layers flattened, etc. I'm guessing this is the problem...

awillustration / 2013-02-28 01:07:36   

Hey Vaska, I wish it was that easy, I've resaved multiple times through multiple programs and even downloaded odd jpgs from Google to the same result. I'd read something about PHP versions and GD library but I haven't got a clear resolution yet, all that ends up uploaded is a black square.
At first it was just a bit temperamental meaning that after a day or two it let me upload but now it's kind of come back permanently :/

Vaska A / 2013-02-28 01:09:59   

My guess is that your host upgraded recently. Send this link to them and ask them to take a look at things...

worcesterwideweb.com/2008/03/17/php-5-and-imagecreatefromjpeg-recoverable-error-premature-end-of-jpeg-file/

Vaska A / 2013-02-28 01:10:30   

Sorry, I'm guessing alot here on this one...it's an odd one. ;)

awillustration / 2013-03-13 19:47:06   

Hey, so I've replaced my media.php with one of my back ups (Update v71) and now I have even more errors:

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in /home/alex/public_html/ndxz-studio/lib/media.php on line 214

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/alex/public_html/ndxz-studio/lib/media.php on line 214

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/home/alex/public_html/files/gimgs//39_cowboy-1000w.jpg' is not a valid JPEG file in /home/alex/public_html/ndxz-studio/lib/media.php on line 214

Warning: Division by zero in /home/alex/public_html/ndxz-studio/lib/media.php on line 291

Warning: Division by zero in /home/alex/public_html/ndxz-studio/lib/media.php on line 292

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/alex/public_html/ndxz-studio/lib/media.php on line 136

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/alex/public_html/ndxz-studio/lib/media.php on line 271

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/alex/public_html/ndxz-studio/lib/media.php on line 165

Warning: Division by zero in /home/alex/public_html/ndxz-studio/lib/media.php on line 291

Warning: Division by zero in /home/alex/public_html/ndxz-studio/lib/media.php on line 292

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/alex/public_html/ndxz-studio/lib/media.php on line 136

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/alex/public_html/ndxz-studio/lib/media.php on line 271

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/alex/public_html/ndxz-studio/lib/media.php on line 165

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/alex/public_html/ndxz-studio/lib/media.php on line 118

Warning: Cannot modify header information - headers already sent by (output started at /home/alex/public_html/ndxz-studio/lib/media.php:214) in /home/alex/public_html/ndxz-studio/lib/template.php on line 66

However I found something about a conflict between PHP 5.2 and GD library 2 ( which I have ) One solution mentioned using : ini_set(‘gd.jpeg_ignore_warning’, 1); to rectify the problem but would that go directly into the media.php?

Vaska A / 2013-03-13 20:45:48   

I really don't know. I don't know why your host can't help you with this - I pointed you in the direction of information that would be helpful.

Never seen this before and it's clear it's a server issue.

This thread has been closed, thank you.