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 | public function __construct(string $name) |
||
32 | |||
33 | public static function create(string $name) |
||
37 | |||
38 | public function getName(): string |
||
42 | |||
43 | /* |
||
44 | * Set the timecode in seconds to extract a video thumbnail. |
||
45 | * Only used on video media. |
||
46 | */ |
||
47 | public function extractVideoFrameAtSecond(int $timecode): Conversion |
||
53 | |||
54 | public function getExtractVideoFrameAtSecond(): int |
||
58 | |||
59 | public function getManipulations(): Manipulations |
||
63 | |||
64 | public function removeManipulation(string $manipulationName) |
||
70 | |||
71 | public function __call($name, $arguments) |
||
81 | |||
82 | /** |
||
83 | * Set the manipulations for this conversion. |
||
84 | * |
||
85 | * @param \Spatie\Image\Manipulations|closure $manipulations |
||
86 | * |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function setManipulations($manipulations) |
||
101 | |||
102 | /** |
||
103 | * Add the given manipulations as the first ones. |
||
104 | * |
||
105 | * @param \Spatie\Image\Manipulations $manipulations |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | public function addAsFirstManipulations(Manipulations $manipulations) |
||
115 | |||
116 | /** |
||
117 | * Set the collection names on which this conversion must be performed. |
||
118 | * |
||
119 | * @param $collectionNames |
||
120 | * |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function performOnCollections(...$collectionNames) |
||
129 | |||
130 | /* |
||
131 | * Determine if this conversion should be performed on the given |
||
132 | * collection. |
||
133 | */ |
||
134 | public function shouldBePerformedOn(string $collectionName): bool |
||
147 | |||
148 | /** |
||
149 | * Mark this conversion as one that should be queued. |
||
150 | * |
||
151 | * @return $this |
||
152 | */ |
||
153 | public function queued() |
||
159 | |||
160 | /** |
||
161 | * Mark this conversion as one that should not be queued. |
||
162 | * |
||
163 | * @return $this |
||
164 | */ |
||
165 | public function nonQueued() |
||
171 | |||
172 | /* |
||
173 | * Determine if the conversion should be queued. |
||
174 | */ |
||
175 | public function shouldBeQueued(): bool |
||
179 | |||
180 | /* |
||
181 | * Get the extension that the result of this conversion must have. |
||
182 | */ |
||
183 | public function getResultExtension(string $originalFileExtension = ''): string |
||
191 | } |
||
192 |