This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23511 - <img>: Expose EXIF data of images in <img> elements
Summary: <img>: Expose EXIF data of images in <img> elements
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other All
: P3 enhancement
Target Milestone: Needs Impl Interest
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-14 21:36 UTC by Ian 'Hixie' Hickson
Modified: 2017-07-21 11:07 UTC (History)
4 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2013-10-14 21:36:32 UTC
On Fri, 7 Jun 2013, David Flanagan wrote:
>
> Allow direct read/write access to EXIF metadata via HTMLImageElement.
> The primary use case for read access is to enable web apps to
> trivially determine when, where, and how a photo was taken and also
> to determine authorship and copyright information for an image. The
> primary use case for write access might be for selectively stripping
> metadata. It would be nice to be able to protect user privacy with
> code as simple as |delete image.metadata.geolocation| for example.

On Fri, 14 Jun 2013, Mark Callow wrote:
>
> I think the primary use case is to make it trivial for JS to be able
> to orient an image according to its EXIF orientation when displaying
> it on the page. And this use case is huge. The vast majority of
> cameras today tag images with the camera's orientation when a
> picture is made. Today you have the following choices in order to
> have the image displayed correctly:
>
> 1. create a copy of the image rotated to a top-left orientation
> 2. manually apply a CSS style that rotates the image according to its
>    specific orientation
> 3. A hack using BinaryBlobs, extensive knowledge of the EXIF metadata
>    format and I don't know what else.

On Thu, 13 Jun 2013, Jonas Sicking wrote:
>
> Wouldn't an even better solution be to make browsers support that EXIF
> metadata and simply render the image correctly without any action from
> the page? At least assuming that the EXIF metadata for orientation is
> standardized and implemented consistently between cameras?

On Fri, 14 Jun 2013, Mark Callow wrote:
>
> It would, except that I think it would break a lot of existing web pages
> whose images have been rotated to a top-left orientation but whose EXIF
> metadata says something else. There was a period of years after EXIF
> appeared when many tools did not handle EXIF metadata, but, because it
> is packaged in a standard APP block of the JPG/JFIF format, may well
> have copied it unchanged into destination files after processing.
>
> Also images on sites using such a feature could appear with incorrect
> orientation in older browsers. The same could be said of rotating via
> JS/CSS, that reads EXIF from the HTMLImageElement, but at least the JS
> could issue a warning and recommend updating to a more recent browser.
>
> The EXIF orientation is standardized and handled consistently. However
> cameras without orientation sensors, i.e., older or cheaper cameras or
> cell phones, will set it to top left. But users of such cameras will
> notice the incorrect orientation when viewing on their computers and
> will rotate the images.
Comment 1 Silvia Pfeiffer 2014-05-19 09:05:01 UTC
I'm considering a similar problem for video/audio tag.

Maybe we can have a JSONObject or JSONArray in the HTMLImageElement that exposes whatever structured metadata the UA finds and leave the rest to JS?
Comment 2 Ian 'Hixie' Hickson 2014-05-19 19:53:57 UTC
We have to define the format of the data that's exposed, otherwise we'll have an interop disaster on our hands. So e.g. to expose EXIF as some sort of JS object, you'd need to first define a mapping from EXIF to JS object. That's what this bug is all about.
Comment 3 Anne 2017-07-21 11:07:05 UTC
Please file a new issue at https://github.com/whatwg/html/issues/new if this is still desired.