Sanity image-url crop(mode) documentation link broken - where is it?

3 replies
Last updated: Sep 5, 2023
On https://www.sanity.io/docs/image-url
crop(mode)
's "documentation" link doesn't go anywhere. Does anyone have the actual link?
AI Update

Looking at the page you mentioned, I can see the issue! The crop(mode) parameter documentation on https://www.sanity.io/docs/image-url does have what appears to be a broken "documentation" link.

However, the good news is that all the documentation for crop modes is actually already on that same page - it's not missing, just that the link appears to be broken or unnecessary.

The crop parameter documentation is in the "The URL parameters" section. You can jump directly to it using this anchor link:

https://www.sanity.io/docs/apis-and-sdks/image-urls#crop-749d37d946b6

The documentation explains that you use crop with fit=crop to specify how cropping is performed, with these mode values:

  • top, bottom, left, right: The crop starts from the edge specified (e.g., crop=top,left)
  • center: Will crop around the center of the image
  • focalpoint: Will crop around the focal point specified using the fp-x and fp-y parameters
  • entropy: Attempts to preserve the "most important" part of the image by selecting the crop that preserves the most complex part

So while that "documentation" link may be broken, all the information you need about the crop modes is right there on the main Image transformations page. The broken link should probably just be removed since it's redundant!

Show original thread
3 replies
Good question. Maybe it intends to point here ?
Nice, thank you!
I’ve updated the source document , though I don’t know how long it will take for that to propagate to the Docs (it might require a build).

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?