1 | <?php |
||
9 | class ImageGenerator |
||
10 | { |
||
11 | /** |
||
12 | * @var Server |
||
13 | */ |
||
14 | private $server; |
||
15 | |||
16 | /** |
||
17 | * @var FilenameGeneratorInterface |
||
18 | */ |
||
19 | private $filenameGenerator; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $tmpPath; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $tmpPrefix; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $fallbackImage; |
||
35 | |||
36 | /** |
||
37 | * @param Server $server |
||
38 | * @param FilenameGeneratorInterface $filenameGenerator |
||
39 | * @param null $fallbackImage |
||
40 | * @param null $tmpPath |
||
41 | * @param null $tmpPrefix |
||
42 | */ |
||
43 | public function __construct( |
||
56 | |||
57 | /** |
||
58 | * @param MediaInterface $media |
||
59 | * @param array $parameters |
||
60 | * @return string |
||
61 | * @throws FilesystemException |
||
62 | */ |
||
63 | public function generate(MediaInterface $media, array $parameters) |
||
73 | |||
74 | /** |
||
75 | * @param MediaInterface $media |
||
76 | * @param array $parameters |
||
77 | * @param $filename |
||
78 | * @throws FilesystemException |
||
79 | * @throws \Exception |
||
80 | */ |
||
81 | private function generateImage(MediaInterface $media, array $parameters, $filename) |
||
98 | |||
99 | /** |
||
100 | * @param MediaInterface $media |
||
101 | * @return string |
||
102 | * @throws FilesystemException |
||
103 | */ |
||
104 | private function getImageData(MediaInterface $media) |
||
116 | |||
117 | /** |
||
118 | * @param $filename |
||
119 | * @param $tmp |
||
120 | * @param array $parameters |
||
121 | */ |
||
122 | private function doGenerateImage($filename, $tmp, array $parameters) |
||
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | private function getTemporaryFile() |
||
141 | } |
||
142 |