🐛 — AVIF format support (fix #137)

This commit is contained in:
Luc Didry
2023-12-30 06:43:24 +01:00
parent f5867f4fd6
commit 5c0504d5d4
4 changed files with 12 additions and 7 deletions
+6 -2
View File
@@ -416,7 +416,9 @@ sub add {
my $path = 'files/'.$record->short.'.'.$ext;
my ($width, $height);
if ($im_loaded && $mediatype ne 'image/svg+xml' && $mediatype !~ m#image/(x-)?xcf# && $mediatype ne 'image/webp') { # ImageMagick don't work in Debian with svg (for now?)
if ($im_loaded && $mediatype ne 'image/svg+xml' # ImageMagick doesn't work with SVG, xcf or avif files
&& $mediatype !~ m#image/(x-)?xcf#
&& $mediatype ne 'image/avif') {
my $im = Image::Magick->new;
$im->BlobToImage($upload->slurp);
@@ -484,7 +486,9 @@ sub add {
}
unless (defined($keep_exif) && $keep_exif) {
if ($mediatype ne 'image/svg+xml' && $mediatype !~ m#image/(x-)?xcf# && $mediatype ne 'image/webp') {
# Exiftool cant process SVG or xcf files
if ($mediatype ne 'image/svg+xml'
&& $mediatype !~ m#image/(x-)?xcf#) {
# Remove the EXIF tags
my $data = new IO::Scalar \$upload->slurp();
my $et = Image::ExifTool->new;