|
9 | 9 |
|
10 | 10 | class ImageManipulation |
11 | 11 | { |
| 12 | + public const FORMAT_BMP = 'bmp'; |
| 13 | + public const FORMAT_GIF = 'gif'; |
| 14 | + public const FORMAT_HEIC = 'heic'; |
12 | 15 | public const FORMAT_JPG = 'jpg'; |
13 | 16 | public const FORMAT_PNG = 'png'; |
14 | | - public const FORMAT_GIF = 'gif'; |
15 | 17 | public const FORMAT_TIFF = 'tif'; |
16 | | - public const FORMAT_BMP = 'bmp'; |
17 | 18 | public const FORMAT_WEBP = 'webp'; |
18 | 19 |
|
19 | 20 | public const VALID_IMAGE_FORMATS = [ |
| 21 | + self::FORMAT_BMP, |
| 22 | + self::FORMAT_GIF, |
| 23 | + self::FORMAT_HEIC, |
20 | 24 | self::FORMAT_JPG, |
21 | 25 | self::FORMAT_PNG, |
22 | | - self::FORMAT_GIF, |
23 | 26 | self::FORMAT_TIFF, |
24 | | - self::FORMAT_BMP |
25 | 27 | ]; |
26 | 28 |
|
27 | 29 | public const MIME_TYPE_MAP = [ |
| 30 | + self::FORMAT_BMP => 'image/bmp', |
| 31 | + self::FORMAT_GIF => 'image/gif', |
| 32 | + self::FORMAT_HEIC => 'image/heic', |
28 | 33 | self::FORMAT_JPG => 'image/jpeg', |
29 | 34 | self::FORMAT_PNG => 'image/png', |
30 | | - self::FORMAT_GIF => 'image/gif', |
31 | 35 | self::FORMAT_TIFF => 'image/tiff', |
32 | | - self::FORMAT_BMP => 'image/bmp', |
33 | 36 | self::FORMAT_WEBP => 'image/webp' |
34 | 37 | ]; |
35 | 38 |
|
@@ -182,6 +185,13 @@ public function outputWebpFormat(): self |
182 | 185 | return $this; |
183 | 186 | } |
184 | 187 |
|
| 188 | + public function outputHeicFormat(): self |
| 189 | + { |
| 190 | + $this->setOutputFormat(self::FORMAT_HEIC); |
| 191 | + |
| 192 | + return $this; |
| 193 | + } |
| 194 | + |
185 | 195 | /** |
186 | 196 | * @return callable |
187 | 197 | */ |
|
0 commit comments