From: Sergey Matveev Date: Sun, 30 Oct 2022 14:05:28 +0000 (+0300) Subject: Newer cjxl does not support stdin input X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=7d55cce251611d694bd071740a06f3b73f18e19d Newer cjxl does not support stdin input --- diff --git a/img/bin/transcode-jpg.sh b/img/bin/transcode-jpg.sh index f974f16..b97ff1f 100755 --- a/img/bin/transcode-jpg.sh +++ b/img/bin/transcode-jpg.sh @@ -1,5 +1,7 @@ #!/bin/sh -e -jpegtran -optimize -progressive -perfect -copy all "$1" | - cjxl - "${1%.*}.jxl" -d 0 -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" ]