Skip to content

Instantly share code, notes, and snippets.

Shane Jones shanejones

Block or report user

Report or block shanejones

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active Nov 18, 2019
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
View pagespeed_optimize_images.sh
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} optipng -nb -nc "{}"
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} advpng -z4 "{}"
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow "{}"
find . -type f -name "*.jpg" -o -name "*.JPG" -print0 | xargs -0 -I {} jpegoptim -f --strip-all "{}"
find . -type f -name "*.jpeg" -o -name "*.JPEG" -print0 | xargs -0 -I {} jpegoptim -f --strip-all "{}"
You can’t perform that action at this time.