image-url
image-url copied to clipboard
It includes faulty rect parameter
Why does the imageUrlBuilder add the faulty rect
parameter to the url?
Example
import createImageUrlBuilder from '@sanity/image-url'
const imageUrlBuilder = createImageUrlBuilder({ projectId, dataset })
const url = imageUrlBuilder.image(source).width(300).height(50).fit('clip').url()
console.log(url)
url
outputs https://cdn.sanity.io/images/XXXXXXXX/XXX/filename.png?rect=0,75,1200,200&w=300&h=50&fit=clip. I expected it to be https://cdn.sanity.io/images/XXXXXXXX/XXX/filename.png?w=300&h=50&fit=clip.
This must be a bug? Is there any other way to get the image url and an image constrained within the given width and height without cropping or distorting the image?
Also having this issue on 1.0.2.
Duplicate of #32