1 | <?php |
||
9 | class Conversion |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $name = ''; |
||
13 | |||
14 | /** @var int */ |
||
15 | protected $extractVideoFrameAtSecond = 0; |
||
16 | |||
17 | /** @var \Spatie\Image\Manipulations */ |
||
18 | protected $manipulations; |
||
19 | |||
20 | /** @var array */ |
||
21 | protected $performOnCollections = []; |
||
22 | |||
23 | /** @var bool */ |
||
24 | protected $performOnQueue = true; |
||
25 | |||
26 | /** @var bool */ |
||
27 | protected $keepOriginalImageFormat = false; |
||
28 | |||
29 | public function __construct(string $name) |
||
35 | |||
36 | public static function create(string $name) |
||
40 | |||
41 | public function getName(): string |
||
45 | |||
46 | /* |
||
47 | * Set the timecode in seconds to extract a video thumbnail. |
||
48 | * Only used on video media. |
||
49 | */ |
||
50 | public function extractVideoFrameAtSecond(int $timecode): Conversion |
||
56 | |||
57 | public function getExtractVideoFrameAtSecond(): int |
||
61 | |||
62 | public function keepOriginalImageFormat(): Conversion |
||
68 | |||
69 | public function shouldKeepOriginalImageFormat(): Bool |
||
73 | |||
74 | public function getManipulations(): Manipulations |
||
78 | |||
79 | public function removeManipulation(string $manipulationName) |
||
85 | |||
86 | public function __call($name, $arguments) |
||
96 | |||
97 | /** |
||
98 | * Set the manipulations for this conversion. |
||
99 | * |
||
100 | * @param \Spatie\Image\Manipulations|closure $manipulations |
||
101 | * |
||
102 | * @return $this |
||
103 | */ |
||
104 | public function setManipulations($manipulations) |
||
116 | |||
117 | /** |
||
118 | * Add the given manipulations as the first ones. |
||
119 | * |
||
120 | * @param \Spatie\Image\Manipulations $manipulations |
||
121 | * |
||
122 | * @return $this |
||
123 | */ |
||
124 | public function addAsFirstManipulations(Manipulations $manipulations) |
||
134 | |||
135 | /** |
||
136 | * Set the collection names on which this conversion must be performed. |
||
137 | * |
||
138 | * @param $collectionNames |
||
139 | * |
||
140 | * @return $this |
||
141 | */ |
||
142 | public function performOnCollections(...$collectionNames) |
||
148 | |||
149 | /* |
||
150 | * Determine if this conversion should be performed on the given |
||
151 | * collection. |
||
152 | */ |
||
153 | public function shouldBePerformedOn(string $collectionName): bool |
||
166 | |||
167 | /** |
||
168 | * Mark this conversion as one that should be queued. |
||
169 | * |
||
170 | * @return $this |
||
171 | */ |
||
172 | public function queued() |
||
178 | |||
179 | /** |
||
180 | * Mark this conversion as one that should not be queued. |
||
181 | * |
||
182 | * @return $this |
||
183 | */ |
||
184 | public function nonQueued() |
||
190 | |||
191 | /* |
||
192 | * Determine if the conversion should be queued. |
||
193 | */ |
||
194 | public function shouldBeQueued(): bool |
||
198 | |||
199 | /* |
||
200 | * Get the extension that the result of this conversion must have. |
||
201 | */ |
||
202 | public function getResultExtension(string $originalFileExtension = ''): string |
||
210 | } |
||
211 |