question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resizing png 16-bit colorspace stopped working after 0.29.1 update

See original GitHub issue

After 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 sharps 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:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Feb 1, 2022

v0.30.0 now available, thanks again for reporting.

0reactions
gforgecommented, Nov 3, 2021

Awesome, great to know that this isn’t due to my lack of understanding.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found