Jump to content
MDDHosting Forums

Image handling broken in Drupal 7 running PHP 53


Recommended Posts

Not really the biggest of issues but an issue nonetheless i suppose.

 

So I recently installed Drupal 7 and attempted to add some images but received some fatal errors. Like:

 

Warning: imagecreatefromjpeg(): 'public://Jellyfish.jpg' is not a valid JPEG file in image_gd_load() (line 237 of/home/happyplace/public_html/somesite.org/modules/system/image.gd.inc)
Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in image_gd_load() (line 237 of/home/happyplace/public_html/somesite.org/modules/system/image.gd.inc)

 

Okay, so maybe the Drupal code is broken. So I tried switching over to ImageMagick for processing. Same type of errors are happening ("unable to generate the derived image" most likely similar to the invalid JPEG error from earlier). At this point, I get the feeling it may not be Drupal's fault.

 

*Throw hands up in air*

 

Then I get the idea to switch the Drupal install over to PHP 52 (it was running 53) and lo and behold, everything is working! So I'm thinking maybe the PHP 53 binary or image modules were compiled incorrectly? Who knows...

 

Just thought I'd put that out there. Not a big deal, but PHP 53 does have better performance and I would prefer to use it.

 

Also, feel free to answer my poll! Just a little something I thought would be a good idea. Not for school or official research or anything.

Link to comment
Share on other sites

Not really the biggest of issues but an issue nonetheless i suppose.

 

So I recently installed Drupal 7 and attempted to add some images but received some fatal errors. Like:

 

Warning: imagecreatefromjpeg(): 'public://Jellyfish.jpg' is not a valid JPEG file in image_gd_load() (line 237 of/home/happyplace/public_html/somesite.org/modules/system/image.gd.inc)
Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in image_gd_load() (line 237 of/home/happyplace/public_html/somesite.org/modules/system/image.gd.inc)

 

Okay, so maybe the Drupal code is broken. So I tried switching over to ImageMagick for processing. Same type of errors are happening ("unable to generate the derived image" most likely similar to the invalid JPEG error from earlier). At this point, I get the feeling it may not be Drupal's fault.

 

*Throw hands up in air*

 

Then I get the idea to switch the Drupal install over to PHP 52 (it was running 53) and lo and behold, everything is working! So I'm thinking maybe the PHP 53 binary or image modules were compiled incorrectly? Who knows...

 

Just thought I'd put that out there. Not a big deal, but PHP 53 does have better performance and I would prefer to use it.

 

Also, feel free to answer my poll! Just a little something I thought would be a good idea. Not for school or official research or anything.

 

 

I have the same exact problem! Except I'm running WP.

 

All of my themes that use timthumb.php doesn't work. And I am using php 5.3.

Link to comment
Share on other sites

  • 4 weeks later...

Not really the biggest of issues but an issue nonetheless i suppose.

 

So I recently installed Drupal 7 and attempted to add some images but received some fatal errors. Like:

 

Warning: imagecreatefromjpeg(): 'public://Jellyfish.jpg' is not a valid JPEG file in image_gd_load() (line 237 of/home/happyplace/public_html/somesite.org/modules/system/image.gd.inc)
Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in image_gd_load() (line 237 of/home/happyplace/public_html/somesite.org/modules/system/image.gd.inc)

 

Okay, so maybe the Drupal code is broken. So I tried switching over to ImageMagick for processing. Same type of errors are happening ("unable to generate the derived image" most likely similar to the invalid JPEG error from earlier). At this point, I get the feeling it may not be Drupal's fault.

 

*Throw hands up in air*

 

Then I get the idea to switch the Drupal install over to PHP 52 (it was running 53) and lo and behold, everything is working! So I'm thinking maybe the PHP 53 binary or image modules were compiled incorrectly? Who knows...

 

Just thought I'd put that out there. Not a big deal, but PHP 53 does have better performance and I would prefer to use it.

 

Also, feel free to answer my poll! Just a little something I thought would be a good idea. Not for school or official research or anything.

If you haven't, do open a ticket for this so we can look into it. If you did open a ticket, let me know the ticket ID.

Link to comment
Share on other sites

Sure thing. I'll set up a Drupal sandbox (maybe even try to reproduce Adam's problem with WordPress as well) in the next few hours and I'll post the results here :)

The issue was indeed a change in LibJPEG and we had to rebuild GD/ImageMagick for it but it *should* be working now. I know it's working in 5.2 but I don't have any test sites to try with 5.3.

Link to comment
Share on other sites

Well, it looks like I'm getting the same problem:

Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in image_gd_load() (line 237 of /home/happy_meal/public_html/sb/modules/system/image.gd.inc).
Warning: imagecreatefromjpeg(): 'public://Blue hills.jpg' is not a valid JPEG file in image_gd_load() (line 237 of /home/happy_meal/public_html/sb/modules/system/image.gd.inc).

 

 

This time, I'll try and debug a little bit more. I'll set up a PHP error log and see what's happening in there and I'll post this issue in Drupal's issue tracker. Again, I will post what I find in hopes that this pesky bug get fixed.

Link to comment
Share on other sites

  • 7 months later...

I know the issue is too old but I'm having the same problem today using Drupal 7 in PHP 5.3

Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in image_gd_load() (line 237 of /home/shepherd/public_html/main/modules/system/image.gd.inc).
Warning: imagecreatefromjpeg(): 'public://latenightinthezone.jpg' is not a valid JPEG file in image_gd_load() (line 237 of /home/shepherd/public_html/main/modules/system/image.gd.inc).
Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: in image_gd_load() (line 237 of /home/shepherd/public_html/main/modules/system/image.gd.inc).
Warning: imagecreatefromjpeg(): 'public://latenightinthezone.jpg' is not a valid JPEG file in image_gd_load() (line 237 of /home/shepherd/public_html/main/modules/system/image.gd.inc).

Link to comment
Share on other sites

  • 3 months later...
Oh, and in case anybody is wondering what the issue itself was. It had to do with GD+LibJPEG and mismatched versions. It was a side-effect of something custom that we've done on our servers but it's quite possible for it to happen at another provider as well.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...