File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ export class RawImage {
100100
101101 /**
102102 * Helper method for reading an image from a variety of input types.
103- * @param {RawImage|string|URL } input
103+ * @param {RawImage|string|URL|Blob|HTMLCanvasElement|OffscreenCanvas } input
104104 * @returns The image object.
105105 *
106106 * **Example:** Read image from a URL.
@@ -119,6 +119,10 @@ export class RawImage {
119119 return input ;
120120 } else if ( typeof input === 'string' || input instanceof URL ) {
121121 return await this . fromURL ( input ) ;
122+ } else if ( input instanceof Blob ) {
123+ return await this . fromBlob ( input ) ;
124+ } else if ( input instanceof HTMLCanvasElement || input instanceof OffscreenCanvas ) {
125+ return await this . fromCanvas ( input ) ;
122126 } else {
123127 throw new Error ( `Unsupported input type: ${ typeof input } ` ) ;
124128 }
You can’t perform that action at this time.
0 commit comments