wip + convertis images
This commit is contained in:
parent
809061c551
commit
63b2d2b256
2740 changed files with 856 additions and 564 deletions
68
web/app/uploads/script.fish
Executable file
68
web/app/uploads/script.fish
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/fish
|
||||
|
||||
for jpg in **/*.{jpg,jpeg}
|
||||
echo $jpg
|
||||
|
||||
set -f avif (path change-extension 'avif' "$jpg")
|
||||
set -f jxl (path change-extension 'jxl' "$jpg")
|
||||
set -f png (path change-extension 'png' "$jpg")
|
||||
|
||||
set -f dimensions (magick identify -format "%w-%h" $jpg)
|
||||
set -f dimensions (string split "-" $dimensions)
|
||||
|
||||
if test $dimensions[1] -eq 1920 || test $dimensions[2] -eq 1920
|
||||
set -f a_bonnes_dimensions true
|
||||
else
|
||||
set -f a_bonnes_dimensions false
|
||||
end
|
||||
|
||||
if test -e $avif && test -e $jxl
|
||||
echo -e "\tAll there."
|
||||
continue
|
||||
end
|
||||
|
||||
magick "$jpg" -resize 1920x1920\> "$png" >/dev/null
|
||||
|
||||
if ! test -e $jxl
|
||||
if test $a_bonnes_dimensions = false
|
||||
cjxl \
|
||||
--allow_jpeg_reconstruction=1 \
|
||||
--brotli_effort=11 \
|
||||
--container=1 \
|
||||
--effort=9 \
|
||||
--lossless_jpeg=1 \
|
||||
--num_threads=-1 \
|
||||
--progressive \
|
||||
$png $jxl &>/dev/null
|
||||
|
||||
djxl \
|
||||
--num_threads=-1 \
|
||||
$jxl $jpg &>/dev/null
|
||||
end
|
||||
|
||||
cjxl \
|
||||
--allow_jpeg_reconstruction=0 \
|
||||
--brotli_effort=11 \
|
||||
--container=1 \
|
||||
--effort=10 \
|
||||
--quality=70 \
|
||||
--lossless_jpeg=0 \
|
||||
--num_threads=-1 \
|
||||
--progressive \
|
||||
$png $jxl &>/dev/null
|
||||
echo -e "\t$jxl"
|
||||
|
||||
set -f avif (path change-extension 'avif' "$jpg")
|
||||
if ! test -e $avif
|
||||
avifenc \
|
||||
-q 70 \
|
||||
-s 0 \
|
||||
-c aom \
|
||||
-y 420 \
|
||||
"$png" "$avif" &>/dev/null
|
||||
echo -e "\t$avif"
|
||||
end
|
||||
|
||||
rm $png
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue