#next/image isn't giving good sizes

4 messages · Page 1 of 1 (latest)

hard thicket
#

Hello. I'm planning to use next/image with a CDN, but I've noticed that the image sizes that it gives are very strange. It's only giving two different srcsets (1x and 2x), and actually requests an image with a width larger than my source image (which seems like the opposite of optimizing images 😆). I really just want it to automatically request a variety of widths (that are less than or equal to the source image) based on viewport width. This seems like what it's meant to do normally, but it isn't what's happening.

#

For example, I have a background image that's 1920x1223. It's giving me the following srcsets: https://cdn.cratecode.com/_next/static/media/2.8767f27b.webp?w=1920&q=75 1x, https://cdn.cratecode.com/_next/static/media/2.8767f27b.webp?w=3840&q=75 2x. Neither of these are reducing the requested width. I'm also not sure why it's trying to request a larger image than the source, since that seems like it'll just put stress on the CDN (and increase load times) with no benefit.

#

The only special configuration for images that I have is the custom loader, which shouldn't be doing anything special with it. Is there any configuration option that can fix this issue?

tidal geyser
#

Can you share you code Jonah?