Index: library/Zend/Pdf/Resource/Image/Jpeg.php =================================================================== --- library/Zend/Pdf/Resource/Image/Jpeg.php (revision 18072) +++ library/Zend/Pdf/Resource/Image/Jpeg.php (working copy) @@ -52,13 +52,13 @@ */ public function __construct($imageFileName) { - if (!function_exists('gd_info')) { + if (!function_exists('gd_info') || !function_exists('imagetypes')) { require_once 'Zend/Pdf/Exception.php'; throw new Zend_Pdf_Exception('Image extension is not installed.'); } $gd_options = gd_info(); - if (!$gd_options['JPG Support'] ) { + if ((imagetypes() & IMG_JPG) == 0) { require_once 'Zend/Pdf/Exception.php'; throw new Zend_Pdf_Exception('JPG support is not configured properly.'); } Index: tests/Zend/Pdf/DrawingTest.php =================================================================== --- tests/Zend/Pdf/DrawingTest.php (revision 18072) +++ tests/Zend/Pdf/DrawingTest.php (working copy) @@ -205,14 +205,10 @@ ->restoreGS(); $jpegSupported = false; - if (function_exists('gd_info')) { - $info = gd_info(); - if (isset($info['JPG Support'])) { - $jpegSupported = $info['JPG Support']; - } elseif (isset($info['JPEG Support'])) { - $jpegSupported = $info['JPEG Support']; - } + if (function_exists('imagetypes')) { + $jpegSupported = (imagetypes() & IMG_JPG) != 0; } + if ($jpegSupported) { $stampImageJPG = Zend_Pdf_Image::imageWithPath(dirname(__FILE__) . '/_files/stamp.jpg');