I am trying to resize an image in wordpress using this code
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'My Thumbnail', 300, 100, true ); //(cropped)
}
add_filter('image_size_names_choose', 'my_image_sizes');
function my_image_sizes($sizes) {
$addsizes = array(
"new-size" => __( "New Size")
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
but the radio button for the New Size is disabled on the media uploader so its uncheckable.
I am using wordpress version 3.4.2.Why does it fail?.
I discovered that i hadn’t installed php-gd so i did it in ubuntu like
then added this code in the functions.php
and it worked.