Skip to content

<img>: Have an autorotate="" attribute that honours orientation metadata in the image (e.g. EXIF) #4495

Closed
@zcorpan

Description

@zcorpan

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25508#c26

It seems like there is not enough interest in trying to rotate all images by default. It's also not clear to me that it's a good idea to drop the CSS property, since one might want to rotate e.g. 'content: url(image)' images etc.

I suggest we do this:

  • Keep the CSS property.
  • Add autorotate to <img>
  • Add img[autorotate] { image-orientation: from-image; } to Rendering.
  • Clarify that image-orientation affects naturalWidth, drawImage(), etc.
  • Require that https://html.spec.whatwg.org/multipage/browsers.html#read-media has an autorotate attribute set on the <img> (for top-level images and images in <iframe>s).

or, we could change the initial value of image-orientation from none to from-image (cc @tabatkins ), so all images are rotated "correctly" by default. Use counter data from 2016 found affected images to be ~0.00% of all images.

cc @dbaron

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsimpacts documentationUsed by documentation communities, such as MDN, to track changes that impact documentationtopic: img

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions