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

getImageArray doesn't handles ImageData type #838

Closed
marcorighini opened this issue May 16, 2018 · 2 comments
Closed

getImageArray doesn't handles ImageData type #838

marcorighini opened this issue May 16, 2018 · 2 comments
Assignees

Comments

@marcorighini
Copy link
Contributor

marcorighini commented May 16, 2018

getImageArrayFromDrawable correctly calls getImageArrayFromImageData if input drawable is of type ImageData.

From the documentation seems that getImageArray should correctly handle a source of type ImageData. The problem is that if you provide image of type ImageData a TypeError exception is thrown instead of calling getImageArrayFromDrawable.

@milhidaka milhidaka self-assigned this May 17, 2018
@milhidaka
Copy link
Member

Thanks for bug report. I reproduced it on Firefox 60.0.

Reproduction:
Open MNIST example and type on debug console

let idata = new ImageData(2, 2);
WebDNN.Image.getImageArray(idata);
=> TypeError: Failed to execute "getImageData(image, options)": "image" must be an instance of string, HTMLInputElement, HTMLCanvasElement, HTMLImageElement, or HTMLVideoElement object

WebDNN.Image.getImageArrayFromDrawable(idata);
=> Float32Array(12) [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, … ]

@milhidaka
Copy link
Member

Fix merged to master branch. Please use latest dist/webdnn.js.

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

2 participants