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 15401 - metadata in image files
Summary: metadata in image files
Status: CLOSED DUPLICATE of bug 19056
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Edward O'Connor
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: a11y, a11y_text-alt
Depends on:
Blocks:
 
Reported: 2012-01-03 15:04 UTC by saasha
Modified: 2013-02-12 20:15 UTC (History)
9 users (show)

See Also:


Attachments

Description saasha 2012-01-03 15:04:11 UTC
Hello!

I suggest to add a read-only property in the DOM interface for the img element described at:

http://dev.w3.org/html5/spec/Overview.html#the-img-element

I would tentatively call it "metadata" and it could be used to read metadata embedded in the image file. Here is an example:

Let's assume that the @src attribute links to a PNG file. Such files contain different chunks. As described at
http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.Anc-text one type of chunk is the iTXt-chunk which contains UTF-8 encoded textual metadata. I suggest to be able to retrieve such metadata with JavaScript. This could be achieve with code more or less similar to the following:

img src="foo.png" alt="the foo" id="fooimg"

The JavaScript code could read something similar to:

window.alert(document.getElementById("fooimg").metadata.iTXt.Description);

Likewise, we could retrieve metadata such as: metadata.iTXt.Author metadata.iTXt.Comment etc. from PNG files and similar metadata from other image file formats.

Regards!

Saašha,
Comment 1 Jonathan E. Magen 2012-02-07 19:37:13 UTC
(In reply to comment #0)
> Hello!
> 
> I suggest to add a read-only property in the DOM interface for the img element
> described at:
> 

Might there exist a use-case where a web application might capture a photo from an imaging peripheral and would therefore have a use for setting metadata? Instead, should that happen as a direct manipulation of the bytestream through alternative means such as the Image.toBlob() currently under discussion? If so, does this invalidate the use case of adding a property to the DOM interface in comparison to bundling this functionality as a library?

> http://dev.w3.org/html5/spec/Overview.html#the-img-element
> 
> I would tentatively call it "metadata" and it could be used to read metadata
> embedded in the image file. Here is an example:
> 

> Let's assume that the @src attribute links to a PNG file. Such files contain
> different chunks. As described at
> http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.Anc-text one type of
> chunk is the iTXt-chunk which contains UTF-8 encoded textual metadata. I
> suggest to be able to retrieve such metadata with JavaScript. This could be
> achieve with code more or less similar to the following:
> 
> img src="foo.png" alt="the foo" id="fooimg"
> 
> The JavaScript code could read something similar to:
> 
> window.alert(document.getElementById("fooimg").metadata.iTXt.Description);
> 
> Likewise, we could retrieve metadata such as: metadata.iTXt.Author
> metadata.iTXt.Comment etc. from PNG files and similar metadata from other image
> file formats.
> 

In thinking about this, I can conceive of another use case for such a metadata property. Consider the case of a photo taken with a camera on its side such that the resulting image file contains metadata indicating the proper orientation.

Note that in the instance of a JPEG file, the EXIF metadata might contain the 'Orientation' property with a value of '0,0 is right top' indicating that the image display should rotate 90 degrees to the right. In that case, I might choose to programmatically apply CSS styling to rotate the image for proper presentation.

Alternatively, consider the case where an application might wish to extract geolocation data from an image to plot its point of origin on a map. I feel that this has some interesting possibilities.

> Regards!
> 
> Saašha,

Thank you for giving me something very interesting to consider.
Comment 2 Philippe Le Hegaret 2012-02-07 20:32:44 UTC
There is
 http://www.w3.org/TR/2011/WD-mediaont-api-1.0-20111122/

but looking at the implementation report
 http://www.w3.org/2008/WebVideo/Annotations/drafts/API/implementation-report.html

there is only limited deployment.

Philippe
Comment 3 Robin Berjon 2013-01-21 15:58:12 UTC
Mass move to "HTML WG"
Comment 4 Robin Berjon 2013-01-21 16:00:58 UTC
Mass move to "HTML WG"
Comment 5 Edward O'Connor 2013-02-12 19:49:24 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: No spec change.
Rationale: This is a more general issue (exposing metadata in various
kinds of media files), so I'm marking this as a duplicate of the more
general bug.

*** This bug has been marked as a duplicate of bug 19056 ***