RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to write outside buffer bounds
See original GitHub issueHi,
I’m getting an error when trying to get dimensions of a specific image.
Version: 0.7.4
Stack trace:
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to write outside buffer bounds at boundsError (internal/buffer.js:71:11) at Buffer.readUInt16LE (internal/buffer.js:230:5) at readUInt (C:\PathToProject\node_modules\image-size\lib\readUInt.js:8:17) at extractOrientation (C:\PathToProject\node_modules\image-size\lib\types\jpg.js:74:21) at validateExifBlock (C:\PathToProject\node_modules\image-size\lib\types\jpg.js:49:12) at Object.calculate (C:\PathToProject\node_modules\image-size\lib\types\jpg.js:118:21) at lookup (C:\Projects\PathToProject\node_modules\image-size\lib\index.js:26:35) at module.exports (C:\PathToProject\node_modules\image-size\lib\index.js:122:12)
Usage
import * as sizeOf from 'image-size'; const dimensions = sizeOf(image.path);
Image in question is attached. Somehow I have doubts that this image is corrupted, since I was able to get its dimensions with c# code without problems. Also tried async examples from documentation with same results.
Anything I missed? 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
@PizzaPartyInc the issue you are facing, has been fixed. it’s released as
v0.7.5
@mnpenner from the stacktrace you posted, it sounds like that the image in question was invalid. would it be possible to share the image with me?