Skip to content

sharp v0.31.1 bug with rotation+resize #3391

@asilvas-godaddy

Description

@asilvas-godaddy

Possible bug

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

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

If you cannot confirm both of these, please open an installation issue instead.

Are you using the latest version of sharp?

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

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

System:
    OS: macOS 12.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 494.40 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
    npm: 8.11.0 - ~/.nvm/versions/node/v16.15.1/bin/npm
  npmPackages:
    sharp: ^0.31.1 => 0.31.1 

What are the steps to reproduce?

https://gist.github.com/asilvas-godaddy/2430fb186c51407ccb90b2900c7fd64a

What is the expected behaviour?

Resizing after rotation should not break rotation. This was caught in test suite from https://github.com/asilvas/node-image-steam

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

https://gist.github.com/asilvas-godaddy/2430fb186c51407ccb90b2900c7fd64a

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

Source: https://drive.google.com/file/d/176GYzVQ_bj0X57CvZS5CfgiZzFjTAkMl/view?usp=sharing
The rotated output is correct after flip+90deg rotate. But if also resizing, the orientation breaks.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions