Skip to content

Loading image from dataURL (url) #297

Closed
@lpatiny

Description

@lpatiny

I'm using a webcam and I have a code like:

    const imageSrc = webcamRef.current.getScreenshot();
    const response = await fetch(imageSrc);
    const arrayBuffer = await response.arrayBuffer();
    const image = decode(new Uint8Array(arrayBuffer));

I didn't know this trick to convert a dataURL to arraybuffer.

Should there be a static method readURL in image-js that does allows a URL or dataURL ?

Metadata

Metadata

Assignees

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