RadDevon

WordPress Image Resizing Without php-gd

I ran into a problem recently on the very WordPress installation that runs this blog. After migration from my old hosting provider (Dreamhost) to my new VPS (DigitalOcean), WordPress was no longer resizing images.

I learned that this resizing is typically done by a PHP extension called php-gd. I tried to install the plugin using yum install php-gd, but the process ended complaining about a dependency which wasn’t being met. It appeared there was no way around this.

After posting the problem to StackExchange’s WordPress site, I was alerted to the fact that WordPress recently started using ImageMagick for image resizing.

Being a newcomer to Linux server administration, I still wasn’t sure what to do with this knowledge. I installed ImageMagick with yum install ImageMagick*.

Even with ImageMagick installed I still had no image resizing natively through WordPress (and I’m still not quite sure why this was the case). Luckily, I stumbled into a solution: the ImageMagick Engine plugin for WordPress. The plugin quickly found my ImageMagick install on the server and resizing was working once again.

This plugin has an option to regenerate your thumbnails for existing uploads. This feature is provided because ImageMagick is apparently worlds better at scaling images than php-gd. It worked really nicely for me because I had no additional sizes for the images at all. I used this regenerate functionality to generate them for the first time.

As a bonus, check out the Simple Image Sizes plugin. It’s a great way to add custom sizes for your images that will be generated each time you upload.