Skip to content

Some ImageBitmapSource variants unhandled #87

@reillyeon

Description

@reillyeon

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions