diff --git a/index.php b/index.php index 14c42cd..52452ae 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ @include_once __DIR__ . '/src/webp.php'; function shouldGenerateWebP($file) { - return $file->kirby()->option('kirby3-webp', false) && $file->extension() !== 'svg'; + return $file->kirby()->option('kirby3-webp', false); } function generateWebP($file) { diff --git a/lib/Convert.php b/lib/Convert.php index 342fe0e..873c535 100644 --- a/lib/Convert.php +++ b/lib/Convert.php @@ -29,7 +29,7 @@ public function generateWebP($file) { try { // Checking file type since only images are processed - if ($file->type() == 'image') { + if (in_array($file->extension(), ['jpg', 'jpeg', 'png'])) { // WebPConvert options $path = $file->contentFileDirectory() . '/'; $input = $path . $file->filename();