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
Expected output: data <Buffer 0a 14 1e 0a 14 1e 0a 14 1e 0a 14 1e>
Actual output: data <Buffer 00 00 00 00 00 00 00 00 00 00 00 00>
Additional information
Unit tests cover the case of loading PNG and JPEG which run correctly. But constructing the image manually via create {} turns all bytes into 00.
Calling negate should negate the image, but 00 is instead set to all bytes. When negate(true) is called, 00 is set to all bytes expect for the alpha channel, which is kept untouched.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. It looks like the bit depth of newly-created images was not always being correctly set internally, which triggered a float/int mix-up in the negate operation.
Commit 1d36936 fixes this, adds a unit test that would previously have failed, and also simplifies and corrects the selection of the relevant colourspace.
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?What are the steps to reproduce?
What is the expected behaviour?
Expected output:
data <Buffer 0a 14 1e 0a 14 1e 0a 14 1e 0a 14 1e>
Actual output:
data <Buffer 00 00 00 00 00 00 00 00 00 00 00 00>
Additional information
Unit tests cover the case of loading PNG and JPEG which run correctly. But constructing the image manually via
create {}
turns all bytes into00
.Calling
negate
should negate the image, but00
is instead set to all bytes. Whennegate(true)
is called,00
is set to all bytes expect for the alpha channel, which is kept untouched.The text was updated successfully, but these errors were encountered: