nathanbright Posted January 20, 2016 Share Posted January 20, 2016 (edited) Strange one. I upgraded a shop to version 6 last year (I think it was from v4)Cached images and thumbnails all workingI 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 orginalBut 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 endI 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 goneThe error log is reportingPHP Warning: imagecreatefromjpeg(): bad type specifier while parsing parameters /classes/gd.class.php on line 101GD support is installed (version 2). PHP version 5.3.3Folder permissions are 755 and correct owner and groupGiven no-one else reporting anything like this, I assume there's something specific about our setup but at a lossNathan Edited January 21, 2016 by nathanbright Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 20, 2016 Share Posted January 20, 2016 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=798866Then this: http://php.net/manual/en/function.imagecreatefromjpeg.php#35116and this: http://php.net/manual/en/function.imagecreatefromjpeg.php#65656 Quote Link to comment Share on other sites More sharing options...
nathanbright Posted January 21, 2016 Author Share Posted January 21, 2016 (edited) Ha, completely on the money again, thanksIn case it helps othersYes, 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=798866So 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 PHPNOTE 2: Upgrading Cubecart might remove this fix. If so it will need re-applyingThanks again Edited January 21, 2016 by nathanbright Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.