Image resize options greyed out in WordPress 2.8

Posted on 14 July 2009

I recently jumped from WordPress 2.6 to 2.8.  After doing this I was unable to resize images before posting.  The image resize buttons were greyed out.  I’m using the built in image resizing tool in WordPress.  The solution for my problem was easy – after some digging.  Turns out WordPress changed the way it deals with image resizing in 2.7 and above.   If the GD library isn’t present to create the thumbnails  the buttons are greyed out.  In previous versions WordPress would post the full size and then scale using image size tags.

  • Verify php-gd is installed (#php -m)
  • Install php-gd if missing (#yum install php-gd -on Centos)
  • Restart apache (#service httpd restart)
  • Verify php-gd is now installed (#php -m)
  • I also had to remove the existing images I’d uploaded and then re-upload them to get the resize option to work. GD creates the thumbnails at upload.

You can use the script below originally posted here (thanks blaser) to test your php-gd. If it’s working you will see a black text box with red text. If php-gd isn’t working you will see the image box with a red x.

<?php

header(“Content-type: image/png”);
$im = @imagecreate(110, 20)
or die(“Cannot Initialize new GD image stream”);
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, “A Simple Text String”, $text_color);
imagepng($im);
imagedestroy($im);’

?>


Responses are closed for this post.

Recent Posts

Tag Cloud

Meta

Squishnet is proudly powered by WordPress and the SubtleFlux theme.

Copyright © Squishnet