fix issue with jpg conversion

This commit is contained in:
VirtuBox 2018-07-30 00:44:46 +02:00
parent 8b4eee3ec6
commit 0679681819
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ while IFS='|' read -r f1 f2
do
imagepath="$f2"
# optimize jpg images created in the last 24 hours
find $imagepath -iname "*.jp*" -ctime 0 -print0 | xargs -0 jpegoptim --quiet --strip-all -m76
find $imagepath -iname "*.jpg" -ctime 0 -print0 | xargs -0 jpegoptim --quiet --strip-all -m76
# optimize png images created in the last 24 hours
find $imagepath -iname '*.png' -ctime 0 -print0 | xargs -0 optipng -o7 -quiet -preserve
# convert png to webp
@ -12,7 +12,7 @@ do
if [ ! -f "$webp_version" ]; then
{ cwebp -quiet -lossless {} -o {}.webp; }
fi'
find $imagepath -iname "*.jp*" -ctime 0 -print0 | xargs -0 -I {} \
find $imagepath -iname "*.jpg" -ctime 0 -print0 | xargs -0 -I {} \
bash -c 'webp_version="$0".webp
if [ ! -f "$webp_version" ]; then
{ cwebp -quiet -lossless {} -o {}.webp; }

View File

@ -35,7 +35,7 @@ done
# optimize jpg
jpgoptimize() {
$FIND $imagepath -iname "*.jp*" -print0 | xargs -0 jpegoptim --quiet --strip-all -m76
$FIND $imagepath -iname "*.jpg" -print0 | xargs -0 jpegoptim --quiet --strip-all -m76
echo -ne " jpg optimization [${CGREEN}OK${CEND}]\\r"
echo -ne "\\n"
@ -59,7 +59,7 @@ fi'
echo -ne "\\n"
# convert jpg to webp
$FIND $imagepath -iname "*.jp*" -print0 | xargs -0 -I {} \
$FIND $imagepath -iname "*.jpg" -print0 | xargs -0 -I {} \
bash -c 'webp_version="$0".webp
if [ ! -f "$webp_version" ]; then
{ cwebp -quiet -z 6 -mt {} -o {}.webp; }