Oct
8
2010
Optimizing images is something you should always do for websites. No excuses! If you aren’t doing it, start now. Seriously, it saves bandwidth for you AND your readers. Yahoo even provides a service (Smush.it) to make it simple.
That being said, my wife loves pictures. Every Wednesday she chooses the best from the previous week and shares them on her blog. She uses Windows Live Writer to compiler the post, and likes to add effects to the images before they go out. This makes optimizing them really annoying because I had to go do it after the post was complete.
I started to look around to see if there was a plugin for Live Writer that would send all images through Smush.it before uploading the post, but nothing seemed to be there. I figure I would buckle down and knock one out in a night. After an hour or so of hacking, I present to you Smushy.
It is really quite simple. When you are creating a new post (sorry, it doesn’t work for updating because I didn’t want to have to worry about sending already smushed images through their service again) it pulls all image tags out of the HTML, runs them through the service, and overwrites the one on disk with the optimized one.
It should be fine, but as always, use at your own risk. Please leave feedback below, and let me know if there are any bugs.
One last thing, the more images you have in the post the longer it is going to take. It currently send them off one at a time.
Smushy.cs (3.31 kb)