]> Sergey Matveev's repositories - dotfiles.git/blob - img/bin/transcode-jpg.sh
1f0977d671e4a47e9804306b721e0b99d258d70f
[dotfiles.git] / img / bin / transcode-jpg.sh
1 #!/bin/sh -e
2
3 trap "rm -f \"$1\".jpegtran.jpg" HUP PIPE INT QUIT TERM EXIT
4 jpegtran -optimize -progressive -perfect -copy all "$1" > "$1".jpegtran.jpg
5 cjxl "$1".jpegtran.jpg "${1%.*}.jxl" -q 100 -e 9
6 [ -s "${1%.*}.jxl" ]