Image Resize and thumbnails not working in WordPress.

I had a strange problem on a WordPress blog site today that I haven’t seen before.  The image resize and thumbnail generation wasn’t working.  Normally when you upload an image to WordPress it creates 3 versions of the image at different sizes but this wasn’t happening and I was just left with the large original file.

When I went to insert the image into a post the resize options were disabled (or greyed out).

Wordpress resize disabled

WordPress resize disabled

At first I thought it might have been caused by a problem with the Theme I was using but the problem continued after switching back to one of the standard themes.  Then I checked the directory permissions incase the WordPress install didn’t have authority to write the resized images back to the file system, but again that was all fine.

It turns out that WordPress uses the Apache PHP5-GD library to do it’s resizing and for some reason on the build of Ubuntu Linux on the server I was using this wasn’t installed by default.  To check this I just put a phpinfo(); into a small dummy php file and ran it from the browser.   What you should see is something like this:

Is Apache gd installed?

 

If you don’t see this then it’s simple to install with

sudo apt-get install php5-gd

and then restart Apache and you’re done.

Speak Your Mind

*