Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

crash when the gif only had single frame #29

Open
sjdong opened this issue Apr 11, 2016 · 2 comments
Open

crash when the gif only had single frame #29

sjdong opened this issue Apr 11, 2016 · 2 comments

Comments

@sjdong
Copy link

sjdong commented Apr 11, 2016

func delayForImageAtIndex line 74:
if delayObject.doubleValue == 0 {
delayObject = unsafeBitCast(CFDictionaryGetValue(gifProperties,
unsafeAddressOf(kCGImagePropertyGIFDelayTime)), AnyObject.self)
}
will cause the issues when there is only single frame

i'am newbie to swift, i add this code to fixed the issues. but i don't know whether this is a good way or not.
if count == 1 {
return UIImage(CGImage: CGImageSourceCreateImageAtIndex(source, 0, nil)!)
}

@bahlo
Copy link
Member

bahlo commented Apr 11, 2016

Hey, I'm sorry you're having problems - I will look into this 👌

@thijsheijden
Copy link

Im having this problem at the moment, where would I place that code to fix the issue?

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

No branches or pull requests

3 participants