Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
zendframework1
library
Zend
Pdf
Resource
ImageFactory.php
Go to the documentation of this file.
1
<?php
33
class
Zend_Pdf_Resource_ImageFactory
34
{
35
public
static
function
factory
($filename) {
36
if
(!
is_file
($filename)) {
37
#require_once 'Zend/Pdf/Exception.php';
38
throw
new
Zend_Pdf_Exception
(
"Cannot create image resource. File not found."
);
39
}
40
$extension
= pathinfo($filename, PATHINFO_EXTENSION);
41
/*
42
* There are plans to use Zend_Mime and not file extension. In the mean time, if you need to
43
* use an alternate file extension just spin up the right processor directly.
44
*/
45
switch
(strtolower(
$extension
)) {
46
case
'tif'
:
47
//Fall through to next case;
48
case
'tiff'
:
49
#require_once 'Zend/Pdf/Resource/Image/Tiff.php';
50
return
new
Zend_Pdf_Resource_Image_Tiff
($filename);
51
break
;
52
case
'png'
:
53
#require_once 'Zend/Pdf/Resource/Image/Png.php';
54
return
new
Zend_Pdf_Resource_Image_Png
($filename);
55
break
;
56
case
'jpg'
:
57
//Fall through to next case;
58
case
'jpe'
:
59
//Fall through to next case;
60
case
'jpeg'
:
61
#require_once 'Zend/Pdf/Resource/Image/Jpeg.php';
62
return
new
Zend_Pdf_Resource_Image_Jpeg
($filename);
63
break
;
64
default
:
65
#require_once 'Zend/Pdf/Exception.php';
66
throw
new
Zend_Pdf_Exception
(
"Cannot create image resource. File extension not known or unsupported type."
);
67
break
;
68
}
69
}
70
}
71
Magento\Framework\Backup\is_file
is_file($path)
Definition:
io.php:47
$extension
$extension
Definition:
downloadable_product_with_files_and_sample_url.php:125
Zend_Pdf_Resource_ImageFactory
Definition:
ImageFactory.php:33
Zend_Pdf_Resource_Image_Png
Definition:
Png.php:41
Zend_Pdf_Exception
Definition:
Exception.php:51
Zend_Pdf_Resource_Image_Tiff
Definition:
Tiff.php:38
Zend_Pdf_Resource_Image_Jpeg
Definition:
Jpeg.php:38
Zend_Pdf_Resource_ImageFactory\factory
static factory($filename)
Definition:
ImageFactory.php:35