Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging when attempting to rotate multi-page image #3940

Closed
EjDadivas opened this issue Jan 10, 2024 · 3 comments
Closed

Improve error messaging when attempting to rotate multi-page image #3940

EjDadivas opened this issue Jan 10, 2024 · 3 comments

Comments

@EjDadivas
Copy link

Possible bug

          sharp(await fileItem.toBuffer(), { animated: true })
          .resize(imgMaxWidth)
          .rotate(rotateVal)
          .toFormat("gif")
          .gif({
              loop: 0,
              force: true
          })
          .toFile(gifFileAssetPath, (err, info) => {
              console.log('### err GIF:', err)
              console.log('### info GIF:', info)
          })

When I try to rotate the GIF it only shows the first frame.

@lovell
Copy link
Owner

lovell commented Jan 11, 2024

Rotation of multi-page (animated) images is unsupported. I thought I'd added logic to generate an error when this was attempted but I see it currently doesn't do so when the angle is 90 or 270, leading to unexpected output.

Commit cbf68c1 ensures an error is shown, adds more test cases and a note to the docs.

Thanks for reporting.

@lovell lovell added this to the v0.33.2 milestone Jan 11, 2024
@lovell lovell changed the title After rotating an Animated GIF it only shows first frame Improve error messaging when attempting to rotate multi-page image Jan 11, 2024
@lovell
Copy link
Owner

lovell commented Jan 12, 2024

v0.33.2 now available with improved error messaging around this.

@lovell lovell closed this as completed Jan 12, 2024
@EjDadivas
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants