fix issue with jpg conversion
This commit is contained in:
parent
8b4eee3ec6
commit
0679681819
|
@ -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; }
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue
Block a user