lorenzodejong / next-sanity-image

Utility for using responsive images hosted on the Sanity.io CDN with the Next.js image component.
MIT License
149 stars 20 forks source link

Handle quality from Next #4

Closed RyKilleen closed 3 years ago

RyKilleen commented 3 years ago

At the moment it appears the only values passed on to a custom imageBuilder is width and originalImageDimensions, but Next/Image allows for setting quality as well in a loader.

I know I'd find this valuable

lorenzodejong commented 3 years ago

Hi RyKilleen, thanks for sharing the proposal. I noticed that this was an oversight from my side. Adding the quality by default would however potentially cause a breaking change in existing usages.

I will add the functionality somewhere next week and release a 2.0 version of the library. If you want, you can also send in a PR so we can get this integrated

lorenzodejong commented 3 years ago

Sorry for the delay in the new release, this functionality is now available in the 2.0.0 version (which has just been released on npm). The documentation has been updated as well, i would be glad to hear if this solves your use case!

RyKilleen commented 3 years ago

Awesome, thank you for the update! Excited to check it out