Last active
February 2, 2018 19:08
-
-
Save maliMirkec/89cd0d2125ff3df1eb29455898f73c37 to your computer and use it in GitHub Desktop.
Batch scripts for image optimization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.tecmint.com/optimize-and-compress-jpeg-or-png-batch-images-linux-commandline/ | |
https://blarg.co.uk/blog/recursively-optimize-png-files | |
# install jpegoptim | |
apt-get update | |
apt-get install jpegoptim | |
# install optipng | |
apt-get update | |
apt-get install optipng |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/admin/web/xxx/public_html/wp-content/uploads/ | |
find -name '*.jpg' -print0 | xargs -0 jpegoptim -f --max=80 --preserve --totals | |
sudo chmod 0777 -R /home/admin/web/xxx/public_html/wp-content/uploads/ | |
sudo chown admin:admin -R /home/admin/web/xxx/public_html/wp-content/uploads/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/admin/web/xxx/public_html/wp-content/uploads/ | |
find -name '*.png' -print0 | xargs -0 optipng -nc -nb | |
sudo chmod 0777 -R /home/admin/web/xxx/public_html/wp-content/uploads/ | |
sudo chown admin:admin -R /home/admin/web/xxx/public_html/wp-content/uploads/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment