Custom image size not selectable in uploader

I want to add a custom image size for each image, that is uploaded into posts (via the uploader). I found code-examples on several websites, but somehow they just don’t work for me. This is (the relevant part of) my code inside the functions.php:

function ts_custom_image_sizes(){
    add_theme_support('post-thumbnails');
    add_image_size('ts-menu', 122, 62, true);  
}
add_action('after_theme_setup', 'ts_custom_image_sizes');

function ts_choose_custom_images($sizes) {  
    $custom_sizes = array(  
        'ts-menu' => __('Image for the menu right', 'tsdomain')
    );
    return array_merge( $sizes, $custom_sizes );  
}
add_filter('image_size_names_choose', 'ts_choose_custom_images');

I have to mention that my option is displayed in the uploader of wordpress, but it’s greyed out (not selectable). And there’s no image created in the uploads-folder with the dimensions I set (122×62), just with the standard-dimensions.
I also tried to disable the theme and reload it, but that didn’t help, too.

Related posts

Leave a Reply

1 comment

  1. I had the same problem and found out the php-gd library wasn’t installed on my server.

    Installed it with

    yum install php-gd
    

    restarted and it worked like a charm!