add_image_size() zoom-crop

I’ve set up a bunch of additional image sizes in my functions.php theme file, with the crop parameter set to true. However, the images are resized but not cropped.

    if (function_exists('add_image_size')) {
        add_image_size('frontpage_a-la-une_thumb', 400, 215, true);
        add_image_size('single_thumb', 320, 9999, false);
        add_image_size('category_a-la-une_thumb', 280, 215, true);

        add_image_size('xxs-square-thumb', 60, 60, true);
        add_image_size('xs-square-thumb', 70, 70, true);
        add_image_size('s-square-thumb', 98, 98, true);
        add_image_size('square-thumb', 130, 130, true);
        add_image_size('l-square-thumb', 198, 198, true);

        add_image_size('landscape-thumb', 150, 98, true);
        add_image_size('portrait-thumb', 98, 145, true);
    }

The GD library is installed, so is imageMagick, but no dice.

What am i missing?

UPDATE:
Problem arises with images that are smaller than the set image size: i was expecting WP to create image versions by scaling them up, but it doesn’t. So, my bad, sorry for getting that point wrong.

2 Answers
2

Currently, WordPress core image handling/thumbnail creation does not perform zoom-crop. If you need an intermediate image size to be created explicitly, you will need to ensure that you upload an image with equal or larger dimensions as the intermediate image size.

Leave a Comment