junaidbhura / auto-cloudinary

Super simple Cloudinary auto-upload implementation for WordPress.
https://wordpress.org/plugins/auto-cloudinary/
MIT License
40 stars 9 forks source link

Ignore transformations on SVGs? #45

Closed djmtype closed 3 years ago

djmtype commented 3 years ago

Currently, Cloudinary is converting all images to webp. That's great for the most part except SVGs should be ignored since they're lighter and look better.

Is there anyway to ignore transformations on SVGs?

junaidbhura commented 3 years ago

Hey @djmtype thanks for creating this issue! I'm closing this issue as a duplicate of https://github.com/junaidbhura/auto-cloudinary/issues/15 . I've made a note to add an exception for SVGs.

djmtype commented 3 years ago

@junaidbhura I also posted my question to the Cloudinary forum. Basically, if f_auto is used, the image will be transformed regardless of format.

I'm using ACF and am requesting the full image. I don't know if the site editor will upload an svg, so I need to still fallback on WP's auto generated responsive images just in case a png might be used.

$image_headline = wp_get_attachment_image(get_field('image_headline'), 'full', 0, array('class' => 'image-headline', 'title' => '', 'alt' => ''));

Here is the rendered image source: `

`