CBLImageMetadataWritingHelpers

Objective-C


@interface CBLImageMetadataWritingHelpers : NSObject

Swift

class ImageMetadataWritingHelpers : NSObject

Helper class for writing metadata into image files.

  • Writes the given EXIF orientation into the metadata of the given image data. Does not re-compress or otherwise alter image pixel data.

    Declaration

    Objective-C

    + (nonnull NSData *)writeExifOrientation:(NSUInteger)orientation
                               intoImageData:(nonnull NSData *)imageData;

    Swift

    class func writeExifOrientation(_ orientation: UInt, intoImageData imageData: Data) -> Data

    Parameters

    orientation

    The EXIF orientation.

    imageData

    The image data in which to write the orientation.

    Return Value

    Returns the updated image data.

  • Writes the given image metadata properties into the metadata of the given image data. Does not re-compress or otherwise alter image pixel data.

    Declaration

    Objective-C

    + (nonnull NSData *)writeProperties:(nonnull NSDictionary *)properties
                          intoImageData:(nonnull NSData *)imageData;

    Swift

    class func writeProperties(_ properties: [AnyHashable : Any], intoImageData imageData: Data) -> Data

    Parameters

    properties

    An ImageIO-compatible dictionary of properties. See CGImageProperties.h.

    imageData

    The image data in which to write the orientation.

    Return Value

    Returns the updated image data.