I want to open a discussion about EXIF and resolutions.
The use case - changing the image-resolution in servers/CDN. Some CDN providers like Cloudinary do this today, and use an HTTP header that hasn’t reached consensus with implementors (Content-DPR).
The idea is to use existing EXIF attributes to hint the user agent that an image has an intrinsic size different from its pixel data dimensions, something like a pixel-ratio-multiplier.
The relevant EXIF attributes would be Resolution-X
and Resolution-Y
, and the idea is to have them work hand in hand with the image-resolution CSS attribute.
My initial concrete proposal would be:
- If
image-resolution
isfrom-image
:- If EXIF Resolution-X/Resolution-Y are defined:
- If EXIF
Resolution-Unit
isInch
: compute intrinsic size based on 96dpi - If EXIF
Resolution-Unit
isPixel
: compute intrinsic size based on the x/y units - Otherwise, use the image srcset value or 1dppx.
- If EXIF
- If EXIF Resolution-X/Resolution-Y are defined:
- If
image-resolution
isauto
(which would be the default value, and a new value):- If EXIF Resolution-X/Resolution-Y are defined and
Resolution Unit
isPixel
:- compute intrinsic size based on the x/y units
- Otherwise, use the image srcset value or 1dppx.
- If EXIF Resolution-X/Resolution-Y are defined and
There are probably alternative ways to express it in CSS, the main idea is to allow that EXIF to be respected without breaking current images on the web.
Some alternative would be:
- Use the
Pixel-X-Dimension
andPixel-Y-Dimension
EXIF attributes - Only respect
Pixel
resolution-unit, and avoid adding the newauto
value - Use the existing
Inch
resolution units (usually 72 is the default though while the web’s DPI is 96…) - Create a new attribute for this purpose (pixel-density? Preffered-Display-Dimension?).
Thoughts please!