Definition at line 38 of file Jpeg.php.
◆ __construct()
__construct |
( |
|
$imageFileName | ) |
|
Object constructor
- Parameters
-
- Exceptions
-
Definition at line 51 of file Jpeg.php.
54 #require_once 'Zend/Pdf/Exception.php'; 58 $gd_options = gd_info();
59 if ( (!isset($gd_options[
'JPG Support']) || $gd_options[
'JPG Support'] !=
true) &&
60 (!isset($gd_options[
'JPEG Support']) || $gd_options[
'JPEG Support'] !=
true) ) {
61 #require_once 'Zend/Pdf/Exception.php'; 65 if (($imageInfo =
getimagesize($imageFileName)) ===
false) {
66 #require_once 'Zend/Pdf/Exception.php'; 69 if ($imageInfo[2] != IMAGETYPE_JPEG && $imageInfo[2] != IMAGETYPE_JPEG2000) {
70 #require_once 'Zend/Pdf/Exception.php'; 74 parent::__construct();
76 switch ($imageInfo[
'channels']) {
78 $colorSpace =
'DeviceRGB';
81 $colorSpace =
'DeviceCMYK';
84 $colorSpace =
'DeviceGray';
88 $imageDictionary = $this->_resource->dictionary;
93 if ($imageInfo[2] == IMAGETYPE_JPEG) {
95 }
else if ($imageInfo[2] == IMAGETYPE_JPEG2000){
99 if (($imageFile = @
fopen($imageFileName,
'rb')) ===
false ) {
100 #require_once 'Zend/Pdf/Exception.php'; 103 $byteCount =
filesize($imageFileName);
104 $this->_resource->value =
'';
106 while ($byteCount > 0 && !
feof($imageFile)) {
107 $nextBlock = fread($imageFile, $byteCount);
108 if ($nextBlock ===
false) {
109 #require_once 'Zend/Pdf/Exception.php'; 113 $this->_resource->value .= $nextBlock;
114 $byteCount -= strlen($nextBlock);
116 if ($byteCount != 0) {
117 #require_once 'Zend/Pdf/Exception.php'; 121 $this->_resource->skipFilters();
123 $this->_width = $imageInfo[0];
124 $this->_height = $imageInfo[1];
125 $this->_imageProperties = array();
126 $this->_imageProperties[
'bitDepth'] = $imageInfo[
'bits'];
127 $this->_imageProperties[
'jpegImageType'] = $imageInfo[2];
128 $this->_imageProperties[
'jpegColorType'] = $imageInfo[
'channels'];
◆ getPixelHeight()
◆ getPixelWidth()
◆ getProperties()
Image properties
Definition at line 148 of file Jpeg.php.
◆ $_height
◆ $_imageProperties
◆ $_width
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Pdf/Resource/Image/Jpeg.php