You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find this line in your code seems not correct https://github.com/FdezRomero/request-image-size/blob/master/index.js#L65
If it does return the buffer size(how many bytes) of the img, maybe we should set size.downloaded = Buffer.byteLength(buffer, ''utf8'')
I don't see why buffer.length is incorrect. The image data coming from the response is already a buffer, so I don't see the need to use Buffer.byteLength() here, which seems to be intended for strings anyway. Plus images are binary, so specifying a utf8 encoding would be wrong.
If you think that the downloaded bytes number is incorrect, please provide an example that I can use to reproduce the error.
Hi mate
I find this line in your code seems not correct
https://github.com/FdezRomero/request-image-size/blob/master/index.js#L65
If it does return the buffer size(how many bytes) of the img, maybe we should set
size.downloaded = Buffer.byteLength(buffer, ''utf8'')
Ref
https://nodejs.org/api/buffer.html#buffer_class_method_buffer_bytelength_string_encoding
The text was updated successfully, but these errors were encountered: