Closed gugu closed 8 months ago
Hello, sorry for long response.
https://github.com/Short-io/qr-image (npm test)
I can't install deps in your package in my mac m1. Can you provide a minimal reproducible example?
When I run tests on sharp v0.33 the library fails with SIGABRT
Can you provide a full logs with this error?
RangeError {
code: 'ERR_BUFFER_OUT_OF_BOUNDS',
message: 'Attempt to access memory outside buffer bounds',
}
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
at boundsError (node:internal/buffer:86:11)
at Buffer.readUInt32BE (node:internal/buffer:311:5)
at get width [as width] (/Users/k/dev/w/qr-image/node_modules/looks-same/lib/img-buffer/original-buffer.js:14:29)
at looksSame (/Users/k/dev/w/qr-image/node_modules/looks-same/index.js:174:58)
at assertEqual (/Users/k/dev/w/qr-image/src/tests/_common.ts:19:23)
at <anonymous> (/Users/k/dev/w/qr-image/src/tests/test.ts:248:9)
Can you provide images/buffers on which this error - [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
occurs?
This one: https://github.com/Short-io/qr-image/blob/master/test_data/golden/qr_with_logo_jpg.png You can compare it with itself
This one: https://github.com/Short-io/qr-image/blob/master/test_data/golden/qr_with_logo_jpg.png You can compare it with itself
Hm, I can't reproduce the problem you described. Are you using the latest version of looks-same?
The problem was because two version of sharp installed (0.32 and 0.33), this helps:
"overrides": {
"sharp": "$sharp"
},
When I run tests on sharp v0.33 the library fails with SIGABRT
Example: https://github.com/Short-io/qr-image (npm test)