Throughout my experience of working with WordPress, be it small projects or large projects I have always wanted the ability to do on-demand server side image resizing. For several reasons this is something WordPress has not included in core. With Human Made and the years before, we have used a lot of different solutions for on-demand resizing.
We have been using / developing our own WordPress server side image resizing plugin called WP Thumb for over a year now. WP Thumb is built on top of the great library PHP Thumb (note: that’s notphpThumb which is confusingly a completely different PHP image library). In a nutshell here is a list “features” WP Thumb provides:
Pretty URLs – No ugly ‘phpthumb?args=blah’. More like: ‘uploads/cache/foo-bar-jpg/h456d6.jpg’
Native – WP Thumb directly hooks into all WordPress image functions, use like: ‘the_post_thumbnail( “width=100&height=90&crop=1″ )’
On Demand - The point of WP Thumb is it’s on-demand. Images don’t have to be created / resized on upload. This makes it infinitely more versatile when switching theme, redesigns or using old images in new ways.
Resizing Options - Specifically, “crop”, “resize”, “resize-crop” (also know as zoom-crop or adaptive-resize, “crop from position”
But features are not what makes WP Thumb great. What makes it great is how closely it integrates with WordPress and how versatile it can be. We use WP Thumb on a lot of client sites, ranging up to sites like Digital Trends with over 180,000 images pushed through WP Thumb and over 14 million unique pages views /month, or Yell Marketing. It can scale well.
At it’s most basic, WP Thumb lets you specify a string / array of arguments wherever your could pass a ‘$size’ argument to core WordPress functions. For example:
One of the current experimental features is “background_fill” which will automatically pad images with their existing background colours. Check out more on that and examples On Image Resizing.
The WP Thumb source is available on GitHub at http://github.com/humanmade/wpthumb/. You can download the latest release here, just unzip it to your plugins directory and activate. Alternatively, you can bundle it with your plugin and `include_once()` it directly.