How to Set a Hotspot Crop for an Image Hosted in Sanity
Last updated: Jun 3, 2022
Hi everyone! I'm new to Sanity so my apologies if my question is a bit obvious. I am trying to set a hotspot crop for an image hosted in Sanity and have come across a couple articles that show what appears to be a Sanity image editor where I can set crops easily. How do I access this in the Sanity Studio? Thank you in advance!
Jun 2, 2022, 9:00 PM
! Welcome to the community! You can access that if you click the pencil icon in the top right corner of the component after setting an image.
Jun 2, 2022, 9:04 PM
Thank you for the quick response! I must not be looking in the correct place. This is the menu I see where I've set an image for a field.
Jun 2, 2022, 9:10 PM
Have you set:
Jun 2, 2022, 9:12 PM
You can also append fields to an image type along with the hotspot option - something like this:
I did not have the option set in my schema file. Thank you! Now just looking into how to update that so it reflects in the studio..
Jun 2, 2022, 9:20 PM
If you're working on localhost, it should automatically show the schema changes. If you're in a deployed Studio, you'll need to run
to get them to show up.
Jun 2, 2022, 9:22 PM
Awesome, thank you for sticking with me through this. I was able to access the image editor! Now when setting crops and hotspots in the editor, when I load the document is it supposed to preserve those those crops automatically? Or do I need to specify the cropping withe parameters in the url?