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

Categories: Perl, UNIX (Generic)
Comments: 1 Comment
Published on: Saturday, December 29th, 2012

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 bellow for more info), you can download the patched wesley.pl script here instead.

Did you find this post useful? Share it with your circles / friends, or leave a quick note bellow.

Thank you,

js.

  • jsmoriss-photo
  • Looking for a Sr UNIX Systems Administrator specializing in Systems Integration? I may be available for freelance or contract work, either remotely or on-site. You can contact me by email at jsm@surniaulula.com to discuss your needs, and how my skills might contribute to your success. The Contact Me, Services and Rates pages contain additional information, including my current location and availability schedule.
  • facebook linkedin
Categories: Perl, UNIX (Generic)
Tags: , , , , , , , , , , ,
Published on: Saturday, December 29th, 2012
1 Comment - Leave a comment
  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.

    js.

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>