use jpegoptim for jpeg files and optipng for pngs.
save this code to the file e.g., optimize.sh
change permissions:
and run it in desired folder:
or
find . -name "*.jpg" -exec jpegoptim --strip-all --all-progressive --max=90 {} \;
Source: http://jmperezperez.com/jpegoptim-optimize-jpg-page-speed/
save this code to the file e.g., optimize.sh
#!/bin/bash optimize() { jpegoptim *.jpg --strip-all --all-progressive --max=90 for i in * do if test -d $i then cd $i echo $i optimize cd .. fi done echo } optimize
change permissions:
chmod +x optimize.sh
and run it in desired folder:
./optimize.sh
or
find . -name "*.jpg" -exec jpegoptim --strip-all --all-progressive --max=90 {} \;
Source: http://jmperezperez.com/jpegoptim-optimize-jpg-page-speed/
No comments:
Post a Comment