From 75383fa79838b08a0893a9bb51f25937a09d3e23 Mon Sep 17 00:00:00 2001
From: Noam Rosenthal
When an img
element has a current pixel density that is not 1.0, the
- element's image data must be treated as if its resolution, in device pixels per CSS pixels, was the current pixel density. The image's
- density-corrected intrinsic width and height are the intrinsic width and height after taking into account the current pixel
- density.
Each img
element has preferred density-corrected dimensions,
+ which must initially be undefined.
To determine the a density-corrected intrinsic width and height of
+ img
element img:
+
Set dim to img's preferred density-corrected dimensions. + +
If dim is not undefined, return dim.
Set dim to img's intrinsic dimensions.
Divide dim's width and height by img's current pixel density +
Return dim. +
For example, if the current pixel density is 3.125, that means that there are 300 device pixels per CSS inch, and thus if the image @@ -27798,13 +27805,15 @@ was an English <a href="/wiki/Music_hall">music hall</a> singer, ...
If the user agent is able to determine image request's image's width and - height, and image request is pending request, set image - request's state to partially - available.
img
metadata and set
+ image request's state to
+ partially available.
Otherwise, if the user agent is able to determine image request's image's
- width and height, and image request is current request, update the
- img
element's presentation appropriately and set image request's
+ width and height, and image request is current request,
+ update the img
metadata, and update
+ the img
element's presentation appropriately and set image request's
state to partially
available.
Let the img
element's pending request be null.
When asked to update the image metadata for a given img
, user agents must do the following:
Attempt to read EXIF metadata embedded in the image, as defined in the + image codec.
If img
does not have any EXIF metadata, return.
Let img
's preferred width
correspond to the value of EXIF tag PixelXDimension
+ (0xa002
). If preferred width
is not a number between 1
and 65535
, return.
Let img
's preferred height
correspond to the value of EXIF tag PixelYDimension
+ (0xa003
).
preferred width
is not a number between 1
and 65535
, return.
+ Let img
's resolution unit
correspond to the value of EXIF tag ResolutionUnit
+ (0x0128
). If resolution unit
is not Inches
(2
, return.
Let img
's horizontal resolution
correspond to the value of EXIF tag XResolution
+ (0x011a
).
horizontal resolution
is not a number between 1
and 65535
, return.Let img
's vertical resolution
correspond to the value of EXIF tag YResolution
+ (0x011b
).
vertical resolution
is not a number between 1
and 65535
, return.If img
's width in inches
divided by horizontal resolution
is equal to img
's
+ preferred width
, and img
's height in inches
divided by vertical resolution
is equal to img
's width,
+ set img
's preferred density-corrected dimensions to img
's preferred width
and preferred height
Return.