Undefined index: JPG Support in lib/Zend/Pdf/Resource/Image/Jpeg.php on line 59

Article ID #1099
Revision: 1.5
Last update: 2011-10-14

Invoice printing function in Magento fails (empty page)

applies to Magento 1.3

 

Symptoms

Invoice printing in Magento fails or the following error message is shown on a printing attempt:

Undefined index: JPG Support  in lib/Zend/Pdf/Resource/Image/Jpeg.php on line 59

 

Cause

The reason is changed index of JPG support in GD image processing library of PHP 5.3.

 

Solution

To solve the issue you need to edit lib/Zend/Pdf/Resource/Image/Jpeg.php changing line 59 in the following way:

@@ -20,5 +20,6 @@

         $gd_options = gd_info();
-        if (!$gd_options['JPG Support'] ) {
+        if ( (!isset($gd_options['JPG Support'])  || $gd_options['JPG Support']  != true)  &&
+             (!isset($gd_options['JPEG Support']) || $gd_options['JPEG Support'] != true)  ) {
             #require_once 'Zend/Pdf/Exception.php';



Did this article help you solve your issue?


Average rating: 4.33 (12 votes)

completely useless 1 2 3 4 5 most valuable

Tags: