Gifu icon indicating copy to clipboard operation
Gifu copied to clipboard

Static GIF Image not show properly

Open ruby109 opened this issue 4 years ago • 1 comments

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.

ruby109 avatar May 26 '21 17:05 ruby109

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.

kaishin avatar Jun 06 '21 20:06 kaishin