ascorbic / unpic

Universal image CDN translator
https://unpic.pics/lib
292 stars 35 forks source link

Sanity: "Parameter \"w\" must be a valid integer" #3

Closed JannikWempe closed 1 year ago

JannikWempe commented 1 year ago

Using this with sanity result in this error {"statusCode":400,"error":"Bad Request","message":"Parameter \"w\" must be a valid integer"}. This is due to the URL being regenerated containing a non-integer: https://cdn.sanity.io/images/[REMOVED].jpg?w=230.1779359430605&h=442&fit=min&auto=format.

import { Image } from "@unpic/react";

<Image
    src={image.asset.url}
    layout="constrained"
    height={120}
    aspectRatio={getImageDimensions(image).aspectRatio}
/>
ascorbic commented 1 year ago

Thanks! Transferred this to unpic, because it's an issue with the underlying library