Skip to content

Resizing then extracting Webp images past 16,383 now fails from sharp 0.30.x #3262

@blacha

Description

@blacha

Possible bug

Is this a possible bug in a feature of sharp, unrelated to installation?

  • [ x ] Running npm install sharp completes without error.
  • [ x ] Running node -e "require('sharp')" completes without error.

Are you using the latest version of sharp?

  • [ x ] I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

What are the steps to reproduce?

Example https://github.com/blacha/sharp-resize

What is the expected behaviour?

In sharp 0.29.x I can resize a webp image to basically any size and then extract a region from the enlarged image without any issue. In sharp 0.30.x this now fails with Error: webp: bad image dimensions

await sharp(buffer).resize(32768, 32768)
  .extract({ top: 16384, left: 16384, width: 1024, height: 1024 })
  .webp().toBuffer();

I see some work was done in libvips recently to improve image resizing especially with SVGs, is there a easy way to go back to the old resizing method?

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem

Example https://github.com/blacha/sharp-resize

Please provide sample image(s) that help explain this problem

Sample image in repo.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions