import v1.1.0_beta1 | 2009-08-21

This commit is contained in:
2019-07-17 22:16:19 +02:00
parent 2c1152f0d3
commit 8dee6b1a10
2306 changed files with 251360 additions and 23428 deletions

View File

@ -21,9 +21,6 @@
/** Zend_Pdf_Resource_Image */
require_once 'Zend/Pdf/Resource/Image.php';
/** Zend_Pdf_Exception */
require_once 'Zend/Pdf/Exception.php';
/** Zend_Pdf_Element_Numeric */
require_once 'Zend/Pdf/Element/Numeric.php';
@ -54,18 +51,22 @@ class Zend_Pdf_Resource_Image_Jpeg extends Zend_Pdf_Resource_Image
public function __construct($imageFileName)
{
if (!function_exists('gd_info')) {
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'] ) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('JPG support is not configured properly.');
}
if (($imageInfo = getimagesize($imageFileName)) === false) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Corrupted image or image doesn\'t exist.');
}
if ($imageInfo[2] != IMAGETYPE_JPEG && $imageInfo[2] != IMAGETYPE_JPEG2000) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('ImageType is not JPG');
}
@ -95,6 +96,7 @@ class Zend_Pdf_Resource_Image_Jpeg extends Zend_Pdf_Resource_Image
}
if (($imageFile = @fopen($imageFileName, 'rb')) === false ) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception( "Can not open '$imageFileName' file for reading." );
}
$byteCount = filesize($imageFileName);