honor intrinsic orientation information in drawImage()
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: heycam, Assigned: heycam)
References
Details
(Keywords: dev-doc-needed, site-compat)
Attachments
(1 file, 4 obsolete files)
Browsers are converging on honoring EXIF orientation data for HTML images (per bug 1607667).
For images painted with canvas drawImage(), there are some differences:
-
In WebKit, where there is no
image-orientationproperty (it's effectively alwaysfrom-image), the image drawn to the canvas will honor the EXIF orientation. -
In Chrome, it will also honor the EXIF orientation, unless the value of
image-orientationon thecanvaselement isnone.
| Assignee | ||
Comment 1•6 years ago
|
||
Taking this to ensure it is resolved before bug 1607667 makes it to beta.
Comment 2•6 years ago
|
||
Thanks Cameron! I think if the idea in the CSS WG is to remove image-orientation we should do as WebKit?
| Assignee | ||
Comment 3•6 years ago
|
||
I think the idea is to remove the property once we know that there is no need for image-orientation: none to opt out of any unintentional breakage from flipping the initial value.
I was wrong about WebKit: while in current Safari releases there is no image-orientation, they have recently landed an implementation that supports from-image and none, with from-image` being the initial value, but it hasn't made it into a STP yet.
Comment 4•6 years ago
|
||
The priority flag is not set for this bug.
:lsalzman, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 years ago
|
||
| Assignee | ||
Comment 6•6 years ago
|
||
| Assignee | ||
Comment 7•6 years ago
|
||
| Assignee | ||
Comment 8•6 years ago
|
||
| Assignee | ||
Comment 9•6 years ago
|
||
Note that this does not match what the recently added WPTs require, which
is that the value of image-orientation on the canvas element is used to
determine whether to correctly orient the image. This isn't currently
supported by the HTML spec however; if that gets edited in, we can
update our behavior.
Comment 10•6 years ago
|
||
Can you get Apple/Google to start a discussion on that if they still want it? Seems weird, but not out-of-line with the way <canvas> works I suppose.
Is there an equivalent bug for WebGL APIs? They also appear to take images as input.
| Assignee | ||
Comment 11•6 years ago
|
||
I'll file a separate issue for canvas.
I don't have a separate bug for WebGL, but in the end I'm going to solve this in a more general way, in bug 1616411, that doesn't require any specific updates to canvas or other image consumers. So in this bug I'm only going to land the test renamings.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 12•6 years ago
|
||
Comment 15•6 years ago
|
||
| bugherder | ||
Updated•6 years ago
|
Comment 17•6 years ago
|
||
There's still an outdated note on https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage
drawImage() will ignore all EXIF metadata in images, including the Orientation. This behavior is especially troublesome on iOS devices. You should detect the Orientation yourself and use rotate() to make it right.
Description
•