Skip to content
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

Optional MIME type as argument for takePhoto() #278

Open
anonmos opened this issue Apr 7, 2021 · 0 comments
Open

Optional MIME type as argument for takePhoto() #278

anonmos opened this issue Apr 7, 2021 · 0 comments

Comments

@anonmos
Copy link

anonmos commented Apr 7, 2021

Problem

MIME types cannot be specified as part of the takePhoto() method. The Blob that is returned is the browser default MIME type.

Description

I'm currently using the imagecapture-polyfill library, but find myself having to fork it and use it as a separate library because the takePhoto() method doesn't allow for the specification of a MIME type in its blob creation.

It also appears that the takePhoto() w3c specification does take an argument for PhotoSettings, but that seems like it would be an inappropriate place to shoehorn the MIME type.

Proposal

Update the takePhoto() method within the Media Capture Image spec to include the following function signature:

takePhoto(optional PhotoSettings photoSettings = {}, optional String mimeType)

Pass this MIME type as part of the canvasElement.toBlob() call within the takePhoto() method so that the Blob can have the proper MIME type prepended.

Related Work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant