Wesley.pl optimize script for jpeg, png, and gif

To improve page load times (and Google ranking), you should make sure all jpeg, png, and gif files are properly optimized. Instead of writing my own script for jpegtran, pngcrush, and gifsicle, I used Mike Brittain’s Wesley.pl script on GitHub. It works great, though I did have to modify it to change the “jpegtran -copy” parameter it uses — I need to keep the EXIF on larger files, and strip it from thumbnails. I posted the diff on the GitHub Issues page.

Update 2012-12-31 : In case Mike doesn’t merge my diff, with the addition of the --copy=[all|comments|none] command-line argument (see my comment below for more info), you can download the patched wesley.pl script here instead.

One thought on “Wesley.pl optimize script for jpeg, png, and gif

  1. Here’s the patched version of wesley.pl with the addition of a --copy=[all|comments|none] command-line argument.

    You can download the wesley.pl script here.

    And if you have the perl-Image-ExifTool package installed (yum install perl-Image-ExifTool), you may find my exif-res.sh script useful as well. It can be used to get the resolution of an image, and then run wesley.pl with --copy=none or --copy=add depending on the image size.

    You can download the exif-res.sh script here.


Comments are closed.