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
Buffer with callback doesn't work #132
Comments
@phawxby operating on a buffer, in this case, isn't an async operation. |
I've fixed it for now by not promisifying |
Personally I'd prefer a consistent Could the promisify be handled internally? ie, always return a Promise, but if a Buffer is detected, do the processing in the initial Promise setup before returning, then just resolve with the value immediately. edit: meant to comment on the proposal issue, not this one. Oops. Sorry. |
The codepath for input strings allows for the callback to be invoked.
https://github.com/image-size/image-size/blob/master/lib/index.js#L118
But the codepath for buffers does not, it's always a return breaking the promise.
https://github.com/image-size/image-size/blob/master/lib/index.js#L96
The text was updated successfully, but these errors were encountered: