🐛 — 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
+2 -1
View File
@@ -1,9 +1,10 @@
Revision history for Lutim
0.17.0 ????-??-??
- 🐛 — AVIF format support
0.16.0 2023-12-29
- ⬆️ UUpdate jQuery
- ⬆️ Update jQuery
- 💥 BREAKING CHANGE: no more twitter cards
- 🎨 — Use template literals in js
- 🐛 — Gallery, zip and random URLs are now updated when closing image dialog box
+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;
+2 -2
View File
@@ -180,7 +180,7 @@
</div>
<div class="form-group">
<label for="lutim-file"><%= l('Send an image') %></label>
<input type="file" name="file" id="lutim-file" accept="image/*">
<input type="file" name="file" id="lutim-file" accept="image/*,image/avif">
</div>
<div class="form-group">
<label for="lutim-file-url"><%= l('Upload an image with its URL') %></label>
@@ -228,7 +228,7 @@
<div class="browser">
<label>
<span><%= l('Click to open the file browser') %></span>
<input type="file" name="files[]" multiple="multiple" title='<%= l('Click to open the file browser') %>' accept="image/*">
<input type="file" name="files[]" multiple="multiple" title='<%= l('Click to open the file browser') %>' accept="image/*,image/avif">
</label>
</div>
</div>
+2 -2
View File
@@ -181,7 +181,7 @@
</div>
<div class="form-group">
<label for="lutim-file"><%= l('Send an image') %></label>
<input type="file" name="file" id="lutim-file" accept="image/*">
<input type="file" name="file" id="lutim-file" accept="image/*,image/avif">
</div>
<div class="form-group">
<label for="lutim-file-url"><%= l('Upload an image with its URL') %></label>
@@ -231,7 +231,7 @@
<div class="browser">
<label class="btn">
<span><%= l('Click to open the file browser') %></span>
<input type="file" name="files[]" multiple="multiple" title='<%= l('Click to open the file browser') %>' accept="image/*">
<input type="file" name="files[]" multiple="multiple" title='<%= l('Click to open the file browser') %>' accept="image/*,image/avif">
</label>
</div>
</div>