🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Issue with panoramic photo resolution using Sanity and Next.js

13 replies
Last updated: Jul 12, 2022
hey everyone, running into a strange issue with a panoramic photo that I’m fetching from sanity through
. Is it possible that there is a maximum resolution set for images to be stored? I’ve uploaded an image that is
14999 × 1176
and when I try to fetch the image at a smaller width it comes back underresolution
Jul 11, 2022, 10:13 PM
Hi User. The limit is 268 MP, which you should be well within. What is the code you’re running and when you say “underresolution,” do you mean it works at that size but no larger?
Jul 11, 2022, 10:22 PM
sorry that was a vague thing to say 🤪 it just serves the image at a smaller resolution than what i requested
Jul 12, 2022, 12:46 AM
you can see it in action here https://ejg-zeta.vercel.app/fashion — if you click index on the bottom right and scroll down to the long panoramic image in the index and click on it you’ll see that’s low resolution in comparison to the rest, these are all running the same code
Jul 12, 2022, 2:08 AM
Thanks User. That helps a lot. Do I understand correctly that you’re not setting the width of 3840, but it’s being imposed by the image builder?
Jul 12, 2022, 2:32 AM
i was initially setting the explicit width to make sure it would be served at that scale, but I just removed it to see if I could get any improvement in the size
Jul 12, 2022, 7:40 AM
are you able to reproduce on my vercel deplaoyment?
Jul 12, 2022, 5:20 PM
I see the 3840 pixel wide image.
Jul 12, 2022, 5:26 PM
right so that makes sense, but when you click that photograph to enlarge it, it’s rendering it on the page 8781px wide
Jul 12, 2022, 9:35 PM
my code is remounting this photo in a larger version upon clicking the thumbnail but it’s being returned from the server at a smaller size
Jul 12, 2022, 9:36 PM
you can see here that my code requesting an image at 8787px, but still it’s returning one that’s 3840
Jul 12, 2022, 9:43 PM
doing a bit more testing and I’m noticing this is only happening with
Jul 12, 2022, 9:45 PM
thank you for your help 🙂
Jul 12, 2022, 9:45 PM
Ahh, that’s helpful. Looks like if `next/image`’s devices sizes aren’t configured, the defaults max out at 3840.
Jul 12, 2022, 9:52 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?