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

API gifski_add_frame_rgba(*** double presentation_timestamp) cannot handle last frame with arbitrary duration #197

Open
robin2046 opened this issue Oct 13, 2021 · 2 comments

Comments

@robin2046
Copy link

I am using gifski as c library to assemble GIF file from frames.
Some of the emoj files are using different frame durations for each frame.
I can achieve this by correctly calculating the PTS for each frame.
But the impl cannot handle the case if the last frame want to use a different duration.
I saw in the generated GIF, the duration of last frame is PTS[n] - PTS[n-1]
Seems to be a limitation of this API.
Any idea to fix this?
Thanks.

@kornelski
Copy link
Member

I recommend adding a duplicate frame at the end. gifski will recognize the pixels are the same.

@robin2046
Copy link
Author

robin2046 commented Oct 14, 2021

Yes I thought the same way. Just came to see if you have better recommendation.
So, based on the test result, the workaround is to call gifski_add_frame_rgba() twice, with PTS increased by half of the frame duration each time.
Thanks a lot for your work on the great GifSki library.

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

No branches or pull requests

2 participants