Resizing png 16-bit colorspace stopped working after 0.29.1 update
See original GitHub issueAfter updating to 0.29.1 from 0.29.0 my tests start failing when parsing buffers after resize
What are the steps to reproduce?
I have a resize function that uses sharp
and where the data is sent over a buffer where sharp
fails to reconstruct the 16-bit
data
To reproduce using sharp
s own unit tests:
it("16-bit PNG after resize should retain 16-bit space", async function () {
const img = sharp(fixtures.inputPngWithTransparency16bit);
const orgSpace = (await img.metadata()).space;
const space = await new Promise((resolve, reject) => {
img
.resize(32, 16, { fit: "contain" })
.toBuffer(async function (err, data, info) {
if (err) throw err;
resolve((await sharp(data).metadata()).space);
});
});
assert.equal(space, orgSpace);
});
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Output options - High performance Node.js image processing
Resize large images in common formats to smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions.
Read more >Resizing properly in a world of {default=sRGB} - ImageMagick
Can I say to ImageMagick: Hey ImageMagick, this here image uses the sRGB colour space. Can you resize it to 50% (linear-dimension) and...
Read more >T99186 Saving 16 bit PNG with alpha premultiplies the alpha ...
I have a very bright red object with motion blur (edit: motion blur is not the cause, see answer below). The values of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
v0.30.0 now available, thanks again for reporting.
Awesome, great to know that this isn’t due to my lack of understanding.