batch convert jpeg to heif, warning message
Dear all,
I have used heif-enc to convert my jpg files. Very few of them just turn out totally black. Therefore, gimp becomes the alternative one. The OS is ubuntu 18.04 and gimp 2.10 is installed from the ubuntu software as default.
The small shell program follows:
==============================================
#!/bin/bash
# quality level
ql=0; while [[ ! $ql =~ [[:digit:]] || $ql -lt 50 || $ql -gt 100 ]] ; \
do read -e -p "Enter quality 50-100 : " ql; ql=${ql/.*} ;done
for f in $(find . -iname "*.jpg" -type f 2> /dev/null)
do
infile=${f%.*}.jpg
outfile=${f%.*}.heic
gscript="(let* ((image (car (file-jpeg-load 1 \"$infile\" \"$infile\")))
(drawable (car (gimp-image-active-drawable image)))
)
(file-heif-save 1 image drawable \"$outfile\" \"$outfile\" $ql 0)
)"
# ; 50 quality (int32 0
=================================================
Thanks,
Chuck