Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Configurable Image Optimization Parametrs #52

Open
akshay-ranganath opened this issue Aug 30, 2023 · 1 comment
Open

[Feature] Configurable Image Optimization Parametrs #52

akshay-ranganath opened this issue Aug 30, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@akshay-ranganath
Copy link

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

@colbyfayock
Copy link
Collaborator

@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 colbyfayock added the help wanted Extra attention is needed label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants