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().
The
ImageBitmapSource
union is defined as,This specification does not have cases covering the
Blob
,OffscreenCanvas
orSVGImageElement
cases for this union. The implementation in Chromium handlesOffscreenCanvas
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 callcreateImageBitmap()
with theBlob
and pass the resultingImageBitmap
to thedetect()
method.It may be best to simply redefine handling of this union in terms of
createImageBitmap()
.