1 | <?php |
||
27 | class Image extends \SplFileObject implements ImageInterface |
||
28 | { |
||
29 | /** |
||
30 | * Image context. Must be one of the following values: |
||
31 | * thumbnail, icon, background, logo, footer, strip |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $context; |
||
35 | |||
36 | /** |
||
37 | * All of the pass’s images are loaded using standard UIImage image-loading methods. |
||
38 | * This means, for example, the file name of high resolution versions of the image ends with @2x.png/@3x.png. |
||
39 | * @var integer |
||
40 | */ |
||
41 | protected $density; |
||
42 | |||
43 | /** |
||
44 | * Force "png" extension in case of dynamic conversion of the file, i.e. by CDN. |
||
45 | * |
||
46 | * @var bool |
||
47 | */ |
||
48 | protected $forceExtension; |
||
49 | |||
50 | public function __construct($filename, $context, $forceExtension = false) |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function setContext($context) |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function getContext() |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function setDensity($density) |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function getDensity() |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function getExtension() |
||
106 | } |
||
107 |