Просмотр исходного кода

Expose API to get duration from animated image

Logan Shire 4 лет назад
Родитель
Сommit
65e14419bd
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      Sources/Image/GIFAnimatedImage.swift

+ 3 - 3
Sources/Image/GIFAnimatedImage.swift

@@ -70,7 +70,7 @@ public struct ImageCreatingOptions {
 
 // Represents the decoding for a GIF image. This class extracts frames from an `imageSource`, then
 // hold the images for later use.
-class GIFAnimatedImage {
+public class GIFAnimatedImage {
     let images: [KFCrossPlatformImage]
     let duration: TimeInterval
     
@@ -98,7 +98,7 @@ class GIFAnimatedImage {
     }
     
     // Calculates frame duration for a gif frame out of the kCGImagePropertyGIFDictionary dictionary.
-    static func getFrameDuration(from gifInfo: [String: Any]?) -> TimeInterval {
+    public static func getFrameDuration(from gifInfo: [String: Any]?) -> TimeInterval {
         let defaultFrameDuration = 0.1
         guard let gifInfo = gifInfo else { return defaultFrameDuration }
         
@@ -111,7 +111,7 @@ class GIFAnimatedImage {
     }
 
     // Calculates frame duration at a specific index for a gif from an `imageSource`.
-    static func getFrameDuration(from imageSource: CGImageSource, at index: Int) -> TimeInterval {
+    public static func getFrameDuration(from imageSource: CGImageSource, at index: Int) -> TimeInterval {
         guard let properties = CGImageSourceCopyPropertiesAtIndex(imageSource, index, nil)
             as? [String: Any] else { return 0.0 }