Open smfr opened 5 years ago
Undefined by this specification!
But it obviously makes sense to align with image-orientation, and say that you respect EXIF.
That makes sense indeed, but is it web compatible?
It's also odd that image-resolution
is specified to affect "all raster images used in or on the element. It affects both content images (e.g. replaced elements and generated content) and decorative images" but image-orientation
is not.
Another option would be to have an argument to the image()
function that allows image-orientation-like control.
The CSS Working Group just discussed Should CSS decorative images respect EXIF-orientation by default
, and agreed to the following:
RESOLVED: default behavior for all images to respect exif orientation
Can it be clarified what the above resolution means, in more detail? (To the extent that I or someone else could propose a PR and write tests.)
It's unclear from the meeting minutes whether it's intended that image-orientation
affects CSS images used in an element, or if the orientation metadata in the image should unconditionally be honored.
Chrome Canary does look at image-orientation
on the element, and a recent WebKit build with support for image-orientation
does not (and always follows the orientation metadata).
@zcorpan wrote:
Can it be clarified what the above resolution means, in more detail? (To the extent that I or someone else could propose a PR and write tests.)
It seems to mean that EXIF orientation is always respected, if it occurs before the image data in the file; and always ignored, if it is afterwards.
@tabatkins @fantasai @LeaVerou
There are now 3 tests in WPT although with few passes
I did the Chromium implementation and the intention was to make use of EXIF orientation everywhere while respecting the "image-orientation: none" property if possible (i.e. if there is a reasonable element to pull it from).
There are open issues on WHATWG to add orientation control for canvas image methods. https://github.com/whatwg/html/issues/7210 https://github.com/whatwg/html/issues/8085
My understanding is that the long term goal was to remove the property, and always respect valid EXIF orientation data whenever the image is used. If that is indeed the goal, then we should not be adding parameters to canvas methods.
This is mainly about EXIF after the image data. Browsers did not want to be required to honor this as it would force a re-layout, especially problematic on large images which have already been displayed.
The CSS Working Group just discussed [css-images] Should CSS decorative images respect EXIF-orientation by default
.
I filed https://github.com/w3c/csswg-drafts/issues/11114 on the issue about respecting EXIF depending on where it occurs in the file.
https://drafts.csswg.org/css-images/#the-image-orientation says that image-orientation only affects content images, not decorative images.
But what is the default orientation for a decorative image (e.g. CSS background) which has EXIF data that describes a rotation?