UIImage(Metadata)

@interface UIImage (Metadata)

UIImage category for image metadata, including animation, loop count, format, incremental, etc.

  • UIKit: For static image format, this value is always 0. For animated image format, 0 means infinite looping. Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. AppKit: NSImage currently only support animated via GIF imageRep unlike UIImage. The getter of this property will get the loop count from GIF imageRep The setter of this property will set the loop count from GIF imageRep

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger sd_imageLoopCount;

    Swift

    var sd_imageLoopCount: UInt { get set }
  • UIKit: Check the images array property. AppKit: NSImage currently only support animated via GIF imageRep unlike UIImage. It will check the imageRep’s frame count.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL sd_isAnimated;

    Swift

    var sd_isAnimated: Bool { get }
  • UIKit: Check the isSymbolImage property. Also check the system PDF(iOS 11+) && SVG(iOS 13+) support. AppKit: NSImage supports PDF && SVG && EPS imageRep, check the imageRep class.

    Declaration

    Objective-C

    @property (readonly, nonatomic) BOOL sd_isVector;

    Swift

    var sd_isVector: Bool { get }
  • The image format represent the original compressed image data format. If you don’t manually specify a format, this information is retrieve from CGImage using CGImageGetUTType, which may return nil for non-CG based image. At this time it will return SDImageFormatUndefined as default value.

    Note

    Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.

    Declaration

    Objective-C

    @property (nonatomic) SDImageFormat sd_imageFormat;

    Swift

    var sd_imageFormat: SDImageFormat { get set }
  • A bool value indicating whether the image is during incremental decoding and may not contains full pixels.

    Declaration

    Objective-C

    @property (nonatomic) BOOL sd_isIncremental;

    Swift

    var sd_isIncremental: Bool { get set }