Hi Dato team. My question is not for bug reporting or customer support, but I’m curious about Dato’s handling of responsive images.
I notice that the srcset
attribute in image tags use fractional DPR (0.25, 0.5, 0.75) for small images:
<source srcset="https://www.datocms-assets.com/205/1628405514-dato-multisite.jpg?dpr=0.25&w=950 237w,https://www.datocms-assets.com/205/1628405514-dato-multisite.jpg?dpr=0.5&w=950 475w,https://www.datocms-assets.com/205/1628405514-dato-multisite.jpg?dpr=0.75&w=950 712w,https://www.datocms-assets.com/205/1628405514-dato-multisite.jpg?w=950 950w,https://www.datocms-assets.com/205/1628405514-dato-multisite.jpg?dpr=1.5&w=950 1425w,https://www.datocms-assets.com/205/1628405514-dato-multisite.jpg?dpr=2&w=950 1900w" sizes="(max-width: 810px) 100vw, (max-width: 1000px) 750px, (min-width: 1001px) 950px">
AFAIK, the adjusted width of an image is intrinsic width * dpr.
So the first image’s width is 0.25 * 950 = 370, second image is 0.5 * 950 = 475, so on.
How is this different from just setting the width to 370, 475 etc?