diff --git a/Convertor/Convertor.php b/Convertor/Convertor.php index 5108a7d..2761131 100644 --- a/Convertor/Convertor.php +++ b/Convertor/Convertor.php @@ -70,6 +70,11 @@ public function convertImage(Image $image): Image throw new ConvertorException('WebP conversion is not enabled'); } + // @todo: allowed image mime types over xml + if(!in_array($image->getMimetype(), ['jpeg','jpg','png'])){ + throw new ConvertorException('The follwing image type is not supported ' . $image->getMimetype()); + } + // @todo: https://gitlab.hyva.io/hyva-themes/hyva-compat/magento2-yireo-next-gen-images/-/blob/main/src/Plugin/ConverterPlugin.php#L50 $webpImage = $this->targetImageFactory->create($image, 'webp');