X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=img%2Fbin%2Ftranscode-jpg.sh;h=b97ff1f10943cee8aaf873fb2fafdf0b35e5d4c6;hb=7d55cce251611d694bd071740a06f3b73f18e19d;hp=882cce1f9f59cdd3b0c1731d7d9a2519bd0ab683;hpb=44c3c32ecd830b05572b3a4a7f22ba4ccb1b1f0a;p=dotfiles.git diff --git a/img/bin/transcode-jpg.sh b/img/bin/transcode-jpg.sh index 882cce1..b97ff1f 100755 --- a/img/bin/transcode-jpg.sh +++ b/img/bin/transcode-jpg.sh @@ -1,7 +1,7 @@ #!/bin/sh -e -trap "rm -f \"$1\".jpegtran.jpg" HUP PIPE INT QUIT TERM EXIT -jpegtran -optimize -progressive -perfect -copy all "$1" > "$1".jpegtran.jpg -cjxl "$1".jpegtran.jpg "${1%.*}.jxl" -q 100 -e 9 +tmp=`mktemp` +trap "rm -f $tmp.jpg" HUP PIPE INT QUIT TERM EXIT +jpegtran -optimize -progressive -perfect -copy all "$1" > $tmp.jpg +cjxl $tmp.jpg "${1%.*}.jxl" -d 0 -e 9 --lossless_jpeg=1 [ -s "${1%.*}.jxl" ] -rm "$1"