From 7d55cce251611d694bd071740a06f3b73f18e19d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 30 Oct 2022 17:05:28 +0300 Subject: [PATCH] Newer cjxl does not support stdin input --- img/bin/transcode-jpg.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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" ] -- 2.44.0