WP-Imagefit proportionally resizes images to fit your blog template

WP-Imagefit is extremely simple and serves one purpose: to get images in blog posts to fit inside the columns that contain them. In fact, this plugin is used on this blog, so if you see ever images load wider than the column and then quickly snap to fit the container’s width, it’s this plugin that’s doing that.

I had hacked it to work for my blog theme but decided that I should turn it into a WordPress plugin so I could use it elsewhere (and given that CSS’s max-width attribute not only wasn’t cross-browser, but also shrunk images horizontally, I needed a better solution). So, there you have it.

Go ahead and download it. Installation and setup is standard as long as you have an hAtom-compliant theme like K2 or Sandbox.

Nice work here Chris. This would solve the problem of post image and theme changes. Seeing that I’m constantly fiddling with my design/theme this plugin would eliminate one headache. I’d hate to say how much time I’ve spent changing the widths of my photos.

Haven’t looked at the code yet but it must latch into hentry or entry-content? That’s why it’ll work on hatom only? In any event, thanks for the hard work and community love. You have my appreciation.

@Amos: it only support hAtom blogs for two reasons: 1) to selfishly promote hAtom 2) because I don’t know how to add multiple search classes to the jQuery code (I simply need to do more research into jQuery!).

If you’re not using hAtom, just sub out the containers’ classes for the hAtom-specific class (.hentry) on line 20 in wp-imagefit.php.