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

Path Error on Buffer #51

Open
fatihtelis opened this issue Apr 14, 2021 · 2 comments
Open

Path Error on Buffer #51

fatihtelis opened this issue Apr 14, 2021 · 2 comments

Comments

@fatihtelis
Copy link

fatihtelis commented Apr 14, 2021

Hi,

On getPixels function, url param may also be a Buffer. But, on dom-pixels.js Line 120, it tries to get the extension from url.

var ext = path.extname(url)

When you send a Buffer as argument, path.extname function gives an error since url is not a string.

There has to be control whether the url is a path or not. typeof url or Buffer.isBuffer(url) may be used here.

var ext = typeof url === "string" ? path.extname(url) : null;

Otherwise, path.extname does not accept Buffer as an argument.

@yelhouti
Copy link

yelhouti commented May 3, 2021

Same issue here...

yelhouti added a commit to yelhouti/get-pixels that referenced this issue May 3, 2021
@striezel striezel mentioned this issue Jul 19, 2021
@johnnyshankman
Copy link

+1 Can't get this to work.

My console log says I'm passing in

<Buffer ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 48 00 48 00 00 ff db 00 43 00 08 06 06 07 06 05 08 07 07 07 09 09 08 0a 0c 14 0d 0c 0b 0b 0c 19 12 13 0f ... 508 more bytes>

But then I get

Bad pixels path

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

3 participants