fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

Missing attachmend image size limits Cloudinarys functionality

Stefan Zahnd

Hi

I’m using Cloudinary on two sites using the additional variation images gallery plugin. The images are delivered from Cloudinary; no issue there, but the URL transformations aren’t applied correctly.

I talked a lot with Cloudinary support recently during the integration of Cloudinary on those sites; we figured out that Cloudinary on WordPress only applies URL transformations if an image size (attachment size) is used for those images. If images are displayed without an image size, just the global Cloudinary transformation is applied. These are just quality enhancements, not cropping, trimming, and other specialty stuff.

Cloudinary is working fine using your variation swatches plugin because there is an explicit image size for which URL transformations can be applied for those swatches images.

Screenshot 2025-04-14 at 13.59.12.png

Screenshot 2025-04-14 at 13.55.01.png

The Variation Gallery Images plugin seems to use the woocommerce_single image size, which is generally good but limits this use case. The woocommerce_single image size is somewhat special, and it’s impossible to configure Cloudinary URL transformations for that image size. Therefore, as a workaround, one must create a custom image size or use the woocommerce_thumbnail size instead.

The bottom line, and my question, is whether it is possible to configure the image size used for the variation gallery images.

Screenshot 2025-04-14 at 13.50.09.png

Thank you very much and best regards, Stefan

Hakik Zaman

Hi Stefan,

Thanks for reaching out to us.

We have a filter- woocommerce_gallery_image_size, you can use this filter to add your custom image size.

You can add a custom image size- https://developer.wordpress.org/reference/functions/add_image_size/#comment-296

Then replace the woocommerce_single with your custom image size like this-

add_filter( 'woocommerce_gallery_image_size', function(){
    return 'YOUR_CUSTOM_SIZE';
});

Thank You