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
Specifically, it looks like we're shifting things left by 3 bits instead of 2 bits. Assuming that we have 4-byte pixels (RGB+alpha), we should only shift by 2 bits. (2**2 = 4)
I'm not going to hassle with making a pull-request since this is a one-line fix. Basically, change the bit shift to 2 instead of 2+1. Specifically, the line should read: const end = (start + h * w) << 2;
The text was updated successfully, but these errors were encountered:
Expected Behavior
Running crop() should result in a buffer of the appropriate length
Current Behavior
Running crop() results in a buffer with an incorrect length
Failure Information (for bugs)
There is a bug on this line:
https://github.com/oliver-moran/jimp/blob/master/packages/plugin-crop/src/index.js#L30
Specifically, it looks like we're shifting things left by 3 bits instead of 2 bits. Assuming that we have 4-byte pixels (RGB+alpha), we should only shift by 2 bits. (2**2 = 4)
Steps to Reproduce
(That last line should report true!)
Context
Fix
I'm not going to hassle with making a pull-request since this is a one-line fix. Basically, change the bit shift to 2 instead of 2+1. Specifically, the line should read:
const end = (start + h * w) << 2;
The text was updated successfully, but these errors were encountered: