nuzzaci Width Watcher; a wordpress plugin
Background, Mr Cookie at made-in-england.org asked me if I knew of a way to change the size of the images published to his blog via Flickr. It’s not a case of Mr Cookie being lazy or not capable of resizing images — he’s on holiday and are sending photos directly from his phone to his Flickr account, that then in return post the photo to his blog.
When setting up your blog on Flickr you can select from three sizes; 500, 240 and 100 pixel wide. Most people, like Mr Cookie, find that 500 pixels is a bit to wide. A 500 pixel wide post area forces the lines to run long and extends the recommended 66 characters / 10 words per line (unless, of cause, if you set a really large font-size). 240 pixels and 100 pixels are normally a bit too small if it is a main post image.
Thoughts, The quick fix on Mr Cookie’s blog was a CSS workaround; added a max-width to all the images within the a post — .postclass img{max-width:460px}. But IE 6 and older browsers don’t support max-width.
My next thought was to write a javascript function. But I’m no big fan of the onload flickering behaviour. A webpage need to be fully loaded before any javascript kicks in, so everything done with javascript that changes the look of the site will be noticeable for the trained eye. An example on this is my external link script. Even if there may be ways around the flickering onload behavior, it didn’t feel like the right job for Mr javascript.
Solution, So, let me present the nuzzaci Width Watcher wordpress plugin. It fairly straight forward.
This plugin will look through your posts before they get displayed and make sure that no images are wider than a desired maximum width (specify desired width in the nuzzaciWidthWatcher.php file). If an image is too wide, the plugin will add a height and width attribute to the image so that it will be displayed with the desired width while still keeping the correct ratio. It will ignore all images that already have a width or height attribute and/or if the size is less than the set maximum width. This plugin doesn’t touch the original image or the database.
View the script here, and download it here.
Instructions, Download the file, edit the max width variable, upload it to your plugin folder, log on to your admin section and activate it.
I’m using wordpress 2.0.5 and I have tried it on v2.2, but don’t see why this one shouldn’t work on all versions.
Version History
- v 0.5, Launch.
- v 0.6, Fixed an issue regarding potrait images.



After the WWCD (World Wide Developer Conference) 2007, where Steve Jobs gave a sneak preview of the next version of Apples operation system Mac OS X Leopard, apple.com got a fresh look and feel. The presentation of Leopard and the new look and feel of the website proves the rumors about the death of Aqua. Aqua is the name given to the previous GUI (graphical user interface) for Mac OS X operation system theme. Aqua got introduced in 2000 with the first version of the operating system, Mac OS X Public Beta, and was intended to complement the look of the original semi-transparent plastics of the iMac. It has lived with us for almost a decade, way beyond the semi-transparent hardware, so I believe it’s the right decision to move on.







