Skip to content

Instantly share code, notes, and snippets.

@kidapu
Last active August 8, 2022 02:01
Show Gist options
  • Save kidapu/150e2dc0e3cd8d400482d6a8091eb640 to your computer and use it in GitHub Desktop.
Save kidapu/150e2dc0e3cd8d400482d6a8091eb640 to your computer and use it in GitHub Desktop.
cjpeg mozjpeg optimize
#!/bin/sh
rate=10
srcdir='org'
destdir='optimized'$rate
mkdir $destdir
for inpath in `\find $srcdir -name '*.jpg' -or -name '*.png' `; do
outpath=${inpath/$srcdir/$destdir}
cjpeg -optimize -quality $rate -outfile $outpath $inpath
echo "- - - - - - - -"
echo $inpath
echo $outpath
# cp $inpath $outpath
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment