Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
Are you using the latest version of sharp?
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
System:
OS: macOS 12.6.1
CPU: (10) arm64 Apple M1 Max
Memory: 3.44 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
npmPackages:
sharp: ^0.31.2 => 0.31.2
What are the steps to reproduce?
When doing a conversion to uncompressed tiff and "linear" in the same pipeline, the resulting image is not as expected.
What is the expected behaviour?
The image should be output by the sample code below "as is" (linear(1, 0) being an idempotent operation). This works well with other formats than uncompressed TIFF.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
let buffer = await fs.readFileSync(path.join(__dirname, "resources/images/random-small.jpeg"));
buffer = await sharp(buffer)
.tiff({compression: 'none'})
.linear(1, 0)
.toBuffer();
await sharp(buffer)
.jpeg()
.toFile(path.join(__dirname, "resources/transformed/linear-fail.jpeg"));
Please provide sample image(s) that help explain this problem
This is my test image that I would expect to remain basically unchanged in output with the code above:

This is what the code actually produces (the image is nearly all-white and can therefore hardly be seen):

Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharpcompletes without error.node -e "require('sharp')"completes without error.Are you using the latest version of sharp?
sharpas 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?
When doing a conversion to uncompressed tiff and "linear" in the same pipeline, the resulting image is not as expected.
What is the expected behaviour?
The image should be output by the sample code below "as is" (linear(1, 0) being an idempotent operation). This works well with other formats than uncompressed TIFF.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
Please provide sample image(s) that help explain this problem
This is my test image that I would expect to remain basically unchanged in output with the code above:
This is what the code actually produces (the image is nearly all-white and can therefore hardly be seen):