Skip to content

Metadata access when decoding images #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
padenot opened this issue Apr 29, 2021 · 2 comments
Open

Metadata access when decoding images #201

padenot opened this issue Apr 29, 2021 · 2 comments
Labels
extension Interface changes that extend without breaking. image issues related to image decoding and encoding

Comments

@padenot
Copy link
Collaborator

padenot commented Apr 29, 2021

This specification proposes to demux and decode image files. In addition to be able to display the file, it needs to be able to surface frequently used information about those images. A few query in a search engine shows that this is something overwhelmingly popular (for example on stack overflow, but also searching github for wasm/js based decoders).

What immediately comes to mind is to know the dimension of an image before having decoded it (to prepare layout). But generally lots of info are parsed by the implementation, and then not surfaced to script, which is unfortunate, because it means that developers need to ship a bunch of code (probably compiled to WASM or something like that), to do something that the browser already does (and probably better/faster).

Other things I'm thinking of (not exhaustive):

  • pixel bit depth / decoded image format (to prepare textures/canvas while/before the image is decoded)
  • orientation / more EXIF metadata or other metadata (depending on the format), this is simply necessary to allow layering
  • color space (≠ color space conversion)
@padenot padenot added the image issues related to image decoding and encoding label Apr 29, 2021
@dalecurtis
Copy link
Contributor

Agreed on resolution, orientation, color space, and bit depth.

I'm not sure I follow how the decoded image format would be helpful to know upfront. It may also be difficult to know in the ReadableStream case.

In terms of implementation, we've intentionally been conservative in what we've exposed so far, so we can add these as we come to agreement on them. At present no developers have asked for any metadata though. We removed orientation metadata since no one was asking for it and we couldn't agree on how to specify it to the web. Do we just use the exif code? Do we convert exif to a rotation and mirror pair (documenting which is done first)? Do we use a new enum?

@chcunningham chcunningham added the extension Interface changes that extend without breaking. label May 12, 2021
@chcunningham
Copy link
Collaborator

Triage note: marking 'extension', as new metadata would be surfaced via added attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Interface changes that extend without breaking. image issues related to image decoding and encoding
Projects
None yet
Development

No branches or pull requests

3 participants