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

How to produce animated files from RAW instances in 0.30.0? #3189

Closed
deftomat opened this issue Apr 12, 2022 · 3 comments
Closed

How to produce animated files from RAW instances in 0.30.0? #3189

deftomat opened this issue Apr 12, 2022 · 3 comments
Labels

Comments

@deftomat
Copy link
Contributor

We are upgrading Sharp from 0.2*.0 to 0.30.0 and we discovered that pageHeight property on webp() is not supported anymore.

Our use case is:

  1. Load animated image and extract pageHeight
  2. Extract frames from one tall image
  3. Process each frame separately
  4. Compose frames to one tall image
  5. Save as animated file by using pageHeight

The problem is that each frame is processed by multiple steps. Before each step, new Sharp instance is created with
new Sharp({ raw: { ... } }) constructor and the previous result is piped into it.

By this, we are probably loosing some kind of metadata which tells Sharp to save image as animated.

Previously, it was easy to tell the Sharp that the result is animated as you need to provide pageHeight and everything worked as expected.

@deftomat deftomat changed the title How to produce animated files from RAW instances in 0.30.0 How to produce animated files from RAW instances in 0.30.0? Apr 12, 2022
@lovell
Copy link
Owner

lovell commented Apr 17, 2022

Hi Tomáš, yes, as a side effect of improved resizing/cropping of animated images, this scenario is now currently unsupported.

Thinking about the right place in the API for this, perhaps adding an animated: true option to the future possible enhancement of #1580 would make sense as that feature would be a better solution to your problem.

@deftomat
Copy link
Contributor Author

@lovell Great! I will try to do a PR as we will need it.

@lovell
Copy link
Owner

lovell commented Sep 5, 2022

I've added a note to #1580 (comment) about animated: true - let's track it there.

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

No branches or pull requests

2 participants