Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Is there a way to get the Image Width and Height via the `@sanity/image-url` Package?

1 replies
Last updated: Oct 5, 2021
Is there a way to get the image width and height via the
@sanity/image-url
package?
Oct 5, 2021, 6:41 AM
Not sure if there’s something in the
@sanity/image-url
package now, but I do know the width / height are always listed in the asset id:
"asset": {
  "_ref": "image-50ee4ebeb90531c90d2d383de12f2e973cd6fc71-800x1199-png",
  "_type": "reference"
}
So you can extract them from there
Oct 5, 2021, 2:14 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?