netlify-plugin-cloudinary icon indicating copy to clipboard operation
netlify-plugin-cloudinary copied to clipboard

[Feature] Configurable Image Optimization Parametrs

Open akshay-ranganath opened this issue 2 years ago • 1 comments

Feature Request

Currently, image URLs are published with f_auto,q_auto. Consider adding option so that users can specify additional parameter like width, height, DPR. This settings could be applied in the netlify.toml file.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

akshay-ranganath avatar Aug 30 '23 21:08 akshay-ranganath

@akshay-ranganath what type of granularity would you expect out of configuration of transformations? per image? would this be globally configurable? or perhaps a selector of sorts

borrowing an example from another plugin:

[[plugins]]
 package = "netlify-plugin-visual-diff"
 [plugins.inputs]
   ignoreSelector = "#today,.copyright"

   [[plugins.inputs.browser]]
     name = "chrome"
     width = 1024
     height = 768

   [[plugins.inputs.browser]]
     name = "firefox"
     width = 1920
     height = 1080

we see we can configure an input as an array of objects if we wanted to have some sort of selector-based configuration or something that we can target assets accurately

there's also an idea of borrowing Netlify's existing Large Media transformations API which is somewhat like ours, but allow someone to chain on transformations: https://docs.netlify.com/large-media/transform-images/ - if using the Netlify syntax, could help with migrations maybe?

one problem i potentially foresee with that though is if it changes the image in a way that prevents the page from working as expected, such as if one were to crop an image to a different aspect ratio that isn't what the HTML width and height conforms to, though this may simply be expected user risk and could happen even when hand-crafting this type of thing, though this wouldn't be apparently in development mode given this runs on build

colbyfayock avatar Aug 31 '23 02:08 colbyfayock