1 | <?php |
||
11 | class Conversion |
||
12 | { |
||
13 | /** @var string */ |
||
14 | protected $name = ''; |
||
15 | |||
16 | /** @var int */ |
||
17 | protected $extractVideoFrameAtSecond = 0; |
||
18 | |||
19 | /** @var \Spatie\Image\Manipulations */ |
||
20 | protected $manipulations; |
||
21 | |||
22 | /** @var Illuminate\Support\Collection */ |
||
23 | protected $generatorParams; |
||
24 | |||
25 | /** @var array */ |
||
26 | protected $performOnCollections = []; |
||
27 | |||
28 | /** @var bool */ |
||
29 | protected $performOnQueue = true; |
||
30 | |||
31 | /** @var bool */ |
||
32 | protected $keepOriginalImageFormat = false; |
||
33 | |||
34 | public function __construct(string $name) |
||
50 | |||
51 | public static function create(string $name) |
||
55 | |||
56 | public function getName(): string |
||
60 | |||
61 | public function keepOriginalImageFormat(): Conversion |
||
67 | |||
68 | public function shouldKeepOriginalImageFormat(): Bool |
||
72 | |||
73 | public function getManipulations(): Manipulations |
||
77 | |||
78 | public function removeManipulation(string $manipulationName) |
||
84 | |||
85 | public function __call($name, $arguments) |
||
131 | |||
132 | /** |
||
133 | * Set the manipulations for this conversion. |
||
134 | * |
||
135 | * @param \Spatie\Image\Manipulations|closure $manipulations |
||
136 | * |
||
137 | * @return $this |
||
138 | */ |
||
139 | public function setManipulations($manipulations) |
||
151 | |||
152 | /** |
||
153 | * Add the given manipulations as the first ones. |
||
154 | * |
||
155 | * @param \Spatie\Image\Manipulations $manipulations |
||
156 | * |
||
157 | * @return $this |
||
158 | */ |
||
159 | public function addAsFirstManipulations(Manipulations $manipulations) |
||
169 | |||
170 | /** |
||
171 | * Set the collection names on which this conversion must be performed. |
||
172 | * |
||
173 | * @param $collectionNames |
||
174 | * |
||
175 | * @return $this |
||
176 | */ |
||
177 | public function performOnCollections(...$collectionNames) |
||
183 | |||
184 | /* |
||
185 | * Determine if this conversion should be performed on the given |
||
186 | * collection. |
||
187 | */ |
||
188 | public function shouldBePerformedOn(string $collectionName): bool |
||
201 | |||
202 | /** |
||
203 | * Mark this conversion as one that should be queued. |
||
204 | * |
||
205 | * @return $this |
||
206 | */ |
||
207 | public function queued() |
||
213 | |||
214 | /** |
||
215 | * Mark this conversion as one that should not be queued. |
||
216 | * |
||
217 | * @return $this |
||
218 | */ |
||
219 | public function nonQueued() |
||
225 | |||
226 | /** |
||
227 | * Avoid optimization of the converted image. |
||
228 | * |
||
229 | * @return $this |
||
230 | */ |
||
231 | public function nonOptimized() |
||
237 | |||
238 | /* |
||
239 | * Determine if the conversion should be queued. |
||
240 | */ |
||
241 | public function shouldBeQueued(): bool |
||
245 | |||
246 | /* |
||
247 | * Get the extension that the result of this conversion must have. |
||
248 | */ |
||
249 | public function getResultExtension(string $originalFileExtension = ''): string |
||
261 | |||
262 | /** |
||
263 | * Collection of all ImageGenerator drivers. |
||
264 | */ |
||
265 | protected function getImageGenerators(): Collection |
||
269 | } |
||
270 |