Jump to content

[Resolved]Cached images not getting created


nathanbright

Recommended Posts

Strange one. I upgraded a shop to version 6 last year (I think it was from v4)

Cached images and thumbnails all working

I failed to test creating a new product (!)

The client has now just created a few new products but the images are not appearing properly.

Uploading an image using the media upload tab in the product manager results in the source image uploading to /images/source/. I've re-downloaded it over ftp and checked it is byte for byte the same as the orginal

But no images (the various different size versions) are getting created in the /images/cache/ folder. So the new products have no images showing on the front end

I tried clearing the image cache to see if it was some issue with the format of the new images but then had to restore from backup as all product images were gone

The error log is reporting

PHP Warning:  imagecreatefromjpeg(): bad type specifier while parsing parameters /classes/gd.class.php on line 101

GD support is installed (version 2). PHP version 5.3.3

Folder permissions are 755 and correct owner and group

Given no-one else reporting anything like this, I assume there's something specific about our setup but at a loss

Nathan

 

Edited by nathanbright
Link to comment
Share on other sites

Please view in admin, PHP Info. Scroll to the gd table. Make sure JPEG support is enabled.

This is interesting: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798866

Then this: http://php.net/manual/en/function.imagecreatefromjpeg.php#35116

and this: http://php.net/manual/en/function.imagecreatefromjpeg.php#65656

Link to comment
Share on other sites

Ha, completely on the money again, thanks

In case it helps others

Yes, JPEG enabled, yes to correct header and footer bytes in the image file, reluctant to add a third party metadata stripper 

Problem solved by using the work-around in that bug report https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=798866

So gd.class.php line 101 becomes 

                                        $this->_gdImageSource = imagecreatefromstring(file_get_contents($file));

NOTE: this is because we are still on Debian LTS on that server, so in theory this problem will go away if / when either: (a) the bug above gets fixed (assuming the fix applies to JPG as well as PNG); or (b) we upgrade the server to a modern PHP

NOTE 2: Upgrading Cubecart might remove this fix. If so it will need re-applying

Thanks again

Edited by nathanbright
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.

×
×
  • Create New...