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

Static GIF Image not show properly #174

Open
ruby109 opened this issue May 26, 2021 · 1 comment
Open

Static GIF Image not show properly #174

ruby109 opened this issue May 26, 2021 · 1 comment

Comments

@ruby109
Copy link

ruby109 commented May 26, 2021

If you would like to display a static GIF Image(only 1 frame), the first frame is not added to the image. Also due to it's a static image, it can't be showed by the startAnimatingGIF() function.

There are two ways to show it, use GIFAnimatable's prepareForAnimation(withGIFData:loopCount:completionHandler:) or use other prepareForAnimation then call the updateImageIfNeeded().

I think maybe other function start with prepareForAnimation should also add code like imageContainer.image = UIImage(data: imageData) or the trick which is mentioned above should be added to the documentation.

@kaishin
Copy link
Owner

kaishin commented Jun 6, 2021

Thank you for opening the issue.

I haven't thought about this use case before, but I wonder if Gifu wouldn't be overkill for displaying static GIFs.

I would gladly consider a PR if the changes only minimally affect the API surface. Otherwise I would wait until the next major version since I am expecting some sizable refactors to take place.

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