-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should orientation metadata (such as exif) be used when drawing HTMLImageElements/SVGImageElements to canvas? #10492
Comments
Pretty sure that EXIF tags should be respected (and as per w3c/csswg-drafts#5165 (comment) user agents should act as if it's baked in for opaque images to avoid leaking orientation in addition to width/height). cc @whatwg/canvas |
Yes, this all sounds correct. |
I believe w3c/csswg-drafts#5165 is not relevant here because:
|
I think that’s right @noamr. Would be good to clarify in the spec that:
(perhaps a normative note about how ImageBitmap can be used if more control is required) |
I did the Chromium implementation of image orientation from exif. Looking at the code I wrote back then, Chromium respects the I'm fine with removing that and always orienting according to exif. |
I think it's fine the way it is from a security standpoint, as the canvas pixels would be tainted anyway. |
Its possible it is specified elsewhere, but https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-drawimage doesn't seem to indicate whether orientation metadata (such as exif) should be respected when using
drawImage
.Should it?
And if it should, should a CSS
image-orientation
property (e.g.image-orientation: none
) computed for that image affect the rendering?(my guess/suggestion here on what makes the most sense is that orientation metadata should be respected, but CSS
image-orientation:
should not be, just like the CSS to change the image's width and height is not respected. For users that want more control, ImageBitmap provides nobs).The text was updated successfully, but these errors were encountered: