wip
This commit is contained in:
parent
03af121e92
commit
2d4caefd26
32 changed files with 866 additions and 778 deletions
28
web/app/uploads/script.fish
Executable file → Normal file
28
web/app/uploads/script.fish
Executable file → Normal file
|
|
@ -1,19 +1,17 @@
|
|||
#!/usr/bin/fish
|
||||
|
||||
if type --query gm
|
||||
else
|
||||
echo -e "GraphicsMagick is missing."
|
||||
exit 1
|
||||
# Vérification de la présence des binaires nécessaires.
|
||||
if not type --query gm
|
||||
echo -e "GraphicsMagick is missing."
|
||||
exit 1
|
||||
end
|
||||
if type --query cjxl
|
||||
else
|
||||
echo -e "A JPEGXL encoder (cjxl) is missing."
|
||||
exit 1
|
||||
if not type --query cjxl
|
||||
echo -e "A JPEGXL encoder (cjxl) is missing."
|
||||
exit 1
|
||||
end
|
||||
if type --query avifenc
|
||||
else
|
||||
echo -e "An AVIF encoder (avifenc) is missing."
|
||||
exit 1
|
||||
if not type --query avifenc
|
||||
echo -e "An AVIF encoder (avifenc) is missing."
|
||||
exit 1
|
||||
end
|
||||
|
||||
for jpg in **/*.{jpg,jpeg}
|
||||
|
|
@ -40,9 +38,9 @@ for jpg in **/*.{jpg,jpeg}
|
|||
gm convert "$jpg" -resize 1920x1920\> "$png" >/dev/null
|
||||
|
||||
if ! test -e $jxl
|
||||
# Si les dimensions ne sont pas bonnes, convertis l'image PNG en JPEGXL puis reconstruis une image JPEG.
|
||||
# C'est une forme de redimensionnement lossless.
|
||||
if test $a_bonnes_dimensions = false
|
||||
# Si les dimensions ne sont pas bonnes, convertis l'image PNG en JPEGXL puis reconstruis une image JPEG.
|
||||
# C'est une forme de redimensionnement lossless.
|
||||
if test $a_bonnes_dimensions = false
|
||||
cjxl \
|
||||
--allow_jpeg_reconstruction=1 \
|
||||
--brotli_effort=11 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue