Skip to content

Commit 6813145

Browse files
committed
Accept HEIF images
Fixes #20
1 parent 5a54ddd commit 6813145

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/Model/Traits/Image.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ protected function getAcceptedMimeTypes(): array
3232
'image/bmp',
3333
'image/x-ms-bmp',
3434
'image/gif',
35+
'image/heic',
36+
'image/heif',
3537
'image/jpeg',
3638
'image/pjpeg',
3739
'image/png',
@@ -111,6 +113,8 @@ private function readFileInfo(): void
111113
'image/bmp',
112114
'image/x-ms-bmp',
113115
'image/gif',
116+
'image/heic',
117+
'image/heif',
114118
'image/jpeg',
115119
'image/pjpeg',
116120
'image/png', // We lose animation, even though WebP supports it, but we assume we never use animated PNG anyway

tests/Model/Traits/ImageTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public static function providerSetFile(): iterable
7171
yield 'jpg is converted to webp' => ['image.jpg', 400, 400];
7272
yield 'png is converted to webp' => ['image.png', 400, 300];
7373
yield 'avif is converted to webp' => ['image.avif', 400, 299];
74+
yield 'heif is converted to webp' => ['image.heif', 1440, 960];
7475
yield 'svg is untouched' => ['logo.svg', 445, 488, true];
7576
yield 'webp is untouched' => ['image.webp', 400, 400];
7677
yield 'huge jpg is resized to webp' => ['huge.jpg', 3500, 19];

tests/data/images/image.heif

287 KB
Binary file not shown.

0 commit comments

Comments
 (0)