Closed ascorbic closed 3 years ago
Thanks for the suggestion @ascorbic. I think it makes sense to enable withoutEnlargement
resize option by default (maybe here). If needed we can support a context modifier to opt-out but seems a decent option to be enabled by default.
Yes, I agree. I think in the image proxy context it's reasonable to make that the default. Maybe a modifier enlarge
if it's no longer the default?
I've opened a PR what will fix this. When both dimensions are set, sharp doesn't behave as expected for withoutEnlargement
(it doesn't preserve the requested aspect ratio), so I implemented the limits myself instead.
It would be useful to support the
withoutEnlargement
option. Auto-generated srcsets often contain very large sizes, but can gracefully handle smaller sizes if those are returned instead, saving bandwidth and processor time.This could either be a modifier in the URL or an option passed to the constructor. I'm happy to open a PR if there is a decision on the API.