Skip to content

Commit ef796bc

Browse files
committed
All images are stored as either WebP or SVG
Even possibly superior formats such as AVIF and HEIF, because browser support is not necessarily available, and it simplifies our logic to serve images
1 parent 6813145 commit ef796bc

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/Model/Traits/Image.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,10 @@ private function readFileInfo(): void
108108
$tooBig = $size->getWidth() > $maxSize || $size->getHeight() > $maxSize;
109109

110110
// Pretty much only SVG is better than WebP
111-
$worseThanWebp = in_array($this->getMime(), [
112-
'image/avif',
113-
'image/bmp',
114-
'image/x-ms-bmp',
115-
'image/gif',
116-
'image/heic',
117-
'image/heif',
118-
'image/jpeg',
119-
'image/pjpeg',
120-
'image/png', // We lose animation, even though WebP supports it, but we assume we never use animated PNG anyway
111+
// We lose PNG animation, even though WebP supports it, but we assume we never use animated PNG anyway
112+
$worseThanWebp = !in_array($this->getMime(), [
113+
'image/webp',
114+
'image/svg+xml',
121115
], true);
122116

123117
if ($tooBig || $worseThanWebp) {

0 commit comments

Comments
 (0)