Closed dianluyuanli closed 1 year ago
ublic extension ZLPhotoBrowserWrapper where Base: UIImage { static func animateGifImage(data: Data) -> UIImage? { // Kingfisher let info: [String: Any] = [ kCGImageSourceShouldCache as String: true, kCGImageSourceTypeIdentifierHint as String: kUTTypeGIF ]
guard let imageSource = CGImageSourceCreateWithData(data as CFData, info as CFDictionary) else {
return UIImage(data: data)
}
let frameCount = CGImageSourceGetCount(imageSource)
guard frameCount > 1 else {
return UIImage(data: data)
}
let interval = max((frameCount+50/2)/50, 1)
var images = [UIImage]()
var frameDuration = [Int]()
Issue Description
Description and Steps
Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.
Info
ZLPhotoBrowser version: e.g. 4.3.9 Device: e.g. iPhone X Device version: e.g. iOS 14.0 Xcode version: e.g. Xcode 12.0
Configuration code of
ZLPhotoConfiguration