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

Some ImageBitmapSource variants unhandled #87

Open
reillyeon opened this issue Feb 11, 2020 · 0 comments
Open

Some ImageBitmapSource variants unhandled #87

reillyeon opened this issue Feb 11, 2020 · 0 comments

Comments

@reillyeon
Copy link
Collaborator

The ImageBitmapSource union is defined as,

typedef (HTMLImageElement or
         SVGImageElement) HTMLOrSVGImageElement;

typedef (HTMLOrSVGImageElement or
         HTMLVideoElement or
         HTMLCanvasElement or
         ImageBitmap or
         OffscreenCanvas) CanvasImageSource;

typedef (CanvasImageSource or
         Blob or
         ImageData) ImageBitmapSource;

This specification does not have cases covering the Blob, OffscreenCanvas or SVGImageElement cases for this union. The implementation in Chromium handles OffscreenCanvas in the most obvious fashion but not the other two.

Handling of Blob inputs is particularly tricky because it requires first decoding the blob. For practical purposes developers should simply call createImageBitmap() with the Blob and pass the resulting ImageBitmap to the detect() method.

It may be best to simply redefine handling of this union in terms of createImageBitmap().

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