{"id":3001,"date":"2014-11-27T14:14:17","date_gmt":"2014-11-27T14:14:17","guid":{"rendered":"http:\/\/www.simonbattersby.com\/blog\/?p=3001"},"modified":"2014-11-27T14:15:12","modified_gmt":"2014-11-27T14:15:12","slug":"imagejpeg-issues-with-php-5-4","status":"publish","type":"post","link":"https:\/\/www.simonbattersby.com\/blog\/2014\/11\/imagejpeg-issues-with-php-5-4\/","title":{"rendered":"imagejpeg issues with PHP 5.4"},"content":{"rendered":"<p>Came across an interesting little issue this afternoon while debugging an issue with a very old osCommerce installation. This particular site uses an on the fly product thumb generator (product_thumb.php) which worked fine with PHP 5.3 but failed with PHP 5.4.<\/p>\r\n<p>After a bit of digging I tracked the issue to this line in the original code:<\/p>\r\n<pre>imagejpeg($src, '', 100);<\/pre>\r\n<p>In PHP 5.4 this fails, and needs to be replaced with:<\/p>\r\n<pre>imagejpeg($src, <span class=\"code_highlight\">NULL<\/span>, 100);<\/pre>\r\n<p>Perhaps this will save someone a bit of time. I didn&#8217;t find this problem noted elsewhere.<\/p>\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>Came across an interesting little issue this afternoon while debugging an issue with a very old osCommerce installation. This particular site uses an on the fly product thumb generator (product_thumb.php) which worked fine with PHP 5.3 but failed with PHP 5.4. After a bit of digging I tracked the issue to this line in the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[37],"class_list":["post-3001","post","type-post","status-publish","format-standard","hentry","category-web-design-and-build","tag-oscommerce"],"_links":{"self":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/3001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/comments?post=3001"}],"version-history":[{"count":2,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/3001\/revisions"}],"predecessor-version":[{"id":3003,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/posts\/3001\/revisions\/3003"}],"wp:attachment":[{"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/media?parent=3001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/categories?post=3001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simonbattersby.com\/blog\/wp-json\/wp\/v2\/tags?post=3001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}