Skip to content

Commit

Permalink
Merge pull request #149 from kernstmediarox/master
Browse files Browse the repository at this point in the history
[!] adjust the convertor class for mime types
  • Loading branch information
jissereitsma authored Sep 6, 2023
2 parents 008aa33 + 5e73975 commit 319e754
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Convertor/Convertor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 319e754

Please sign in to comment.