A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Expose image EXIF metadata through JavaScript

noamr
2020-04-29

Since now JPEG decoders read EXIF for orientation (and hopefully later for resolution), it could be nice to allow developers to read that metadata and any other annotations through JavaScript. That information can contain many interesting nuggets like GPS coordinates and camera info, in addition to the display-relevant resolution/orientation tags.

A possible API Add HTMLImageElement.metadata, which would include a map according to EXIF tags, with human readable names as constants.

Something like: `function getImageTimezone(image) { return image.metadata[HTMLImageMetaData.TimeZoneOffset /* 0x882a */] }

emilio
2020-04-30

See also https://github.com/whatwg/html/issues/4495. I proposed a naturalOrientation at the very least, given naturalWidth and naturalHeight now honor EXIF, and other people have similar proposals.

Maybe worth chiming in?

emilio
2020-04-30

I think I’d be interested in at least prototyping / implementing something on the lines of naturalOrientation to complement natural{Width,Height} in Gecko.

A bit unclear on the use cases for other EXIF bits (other than image viewers and such maybe?), but not opposed to it in principle. Does the rendering engine use other EXIF metadata bits other than orientation for anything else?

noamr
2020-04-30

Hopefully we would use other EXIF bits for resolution, see [Proposal] EXIF / image-resolution: (auto?) and from-image.

I can think of use-cases around geotagging, for example - like positioning images on a map on the client-side.