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

Add the ability to render static gifs #667

Merged
merged 1 commit into from
Feb 9, 2023
Merged

Conversation

Havhingstor
Copy link
Contributor

The ImageView now tests if a gif is an animated gif, so that the animator only tries to animate it, if necessary. A static gif is rendered like any other image.

Previously, it was tried to animate every gif, whether it truly was animated or not. That resulted in no image being rendered at all.

The ImageView now tests if a gif is an animated gif, so that the animator only
tries to animate it, if necessary. A static gif is rendered like any other
image.
@kean
Copy link
Owner

kean commented Feb 8, 2023

Thanks, @Havhingstor. There were a couple of related issues reports, but nobody got to the bottom of this until now.

By the way, I'm considering removing the GIF support from the main framework entirely and directing users to integrate Gifu directly. The integration should only require a single line.

I think it's great to handle this scenario on the ImageView level for now. But I'd suggest also opening a similar PR in Gifu if you have time. I think it should be able to handle this scenario automatically.

Update: might be related kaishin/Gifu#174

@kean
Copy link
Owner

kean commented Feb 8, 2023

I'm wondering how expensive CGImageSourceCreateWithData is going to be? Presumably not too expensive because it's not going to eagerly bitmap the image unless instructed to do so.

@kean kean merged commit df63473 into kean:main Feb 9, 2023
@Havhingstor Havhingstor deleted the static-gif-fix branch February 9, 2023 06:23
@Havhingstor
Copy link
Contributor Author

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants