W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] Add "naturalOrientation" property to <img>

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 26 Aug 2011 13:49:03 -0700
Message-ID: <CAAWBYDBFxKyR=13LAkKNgrt2m5h6SQsguPgH1o-JZsZwiTLzqA@mail.gmail.com>
On Fri, Aug 26, 2011 at 11:13 AM, Karl Dubost <karld at opera.com> wrote:
> Le 26 ao?t 2011 ? 11:37, Tab Atkins Jr. a ?crit :
>> The <img> element should expose a readonly "naturalOrientation"
>> property that returns the EXIF orientation of the image (an integer
>> 1-8), or 1 if the image has no EXIF orientation metadata or it is
>> corrupted or the image type doesn't expose EXIF data at all.
>
>
> Maybe an issue I can see is that people who are working on the image in a certain orientation and other people loading this image from elsewhere. (Think Flickr images for example).
>
> 1. The person makes the edit on Flickr with a UI where the image is rotated by the browser.
> 2. A person browse flickr, find an image (still rotated), get the link and insert it in a blog post. The image is not anymore rotated.

I'm not sure I understand.  Are you talking about uploading a photo to
Flickr, and the upload preview and normal display handle the EXIF
orientation differently?  Or are you talking about editting a photo in
Flickr?

If the former, that's unconnected from this proposal.  That's a CSS
concern, which will be addressed in Image Values 4 with the
'image-orientation' property.  I brought this up because someone gave
me feedback that image-orientation should have an option to respect
the EXIF orientation.  If Flickr uses this CSS property, and does so
in different ways in the two places, that's just a Flickr bug.

If the latter, I don't see the issue.  If Flickr is offering
in-browser editting, they'll do so via canvas.  They need the EXIF
orientation to insert the image correctly, but once it's in there, the
image exported from the canvas is EXIF-free (or has orientation 1, I
dunno what implementations do).  So there's still no problem.


> Why not having a full EXIF API giving access to more date and helping to fix the dates, the location, etc. The same way you do with desktop tools?

We don't have any APIs for manipulating files on your hard-drive, so
you can't "fix" anything.  I wouldn't be opposed to exposing more EXIF
data, but the Google Gears API only exposed mimetype (which is
irrelevant for image editting in canvas), natural width and height
(already exposed as naturalWidth and naturalHeight), and orientation.
Exposing the rest of the data would just need use-cases to justify it.

~TJ
Received on Friday, 26 August 2011 13:49:03 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:35 UTC