Latest 1.4.3
Homepage https://github.com/dvkch/SYPictureMetadata
License Custom
Platforms ios 7.0, tvos 9.0, requires ARC
Dependencies Mantle
Authors

Read and write images metadata using ImageIO and easy to use models.

Example:

    // load metadata from original file
    SYMetadata *metadata = [SYMetadata metadataWithFileURL:imageURL];

    // create IPTC container if not present
    if (!metadata.metadataIPTC)
        metadata.metadataIPTC = [[SYMetadataIPTC alloc] init];

    // edit metadata
    metadata.metadataIPTC.keywords  = @[@"Some test keywords", @"added by SYMetadata example app"];
    metadata.metadataIPTC.city      = @"Lyon";
    metadata.metadataIPTC.credit    = @"© Me 2017";

    // create new image data with original image data and edited metadata
    NSData *data = [NSData dataWithContentsOfURL:imageURL];
    NSData *dataWithMetadata = [SYMetadata dataWithImageData:data andMetadata:metadata];

    // load metadata for newly cerated image
    SYMetadata *metadataNew = [SYMetadata metadataWithImageData:dataWithMetadata];

    // log the delta in file size
    NSLog(@"Delta: %ld bytes", (unsigned long)dataWithMetadata.length - (unsigned long)data.length);

    // log the differences between files
    NSLog(@"Differences:n%@", [NSDictionary sy_differencesFrom:metadata.originalDictionary
                                                             to:metadataNew.originalDictionary
                                            includeValuesInDiff:YES]);

Keep in mind

When saving metadata to a file you can encouter the following issues:

  • metadata was not written
  • metadata was modified a bit
  • metadata was added

This library uses ImageIO which has its own limitations and performs its own value checks. This is just a wrapper around the NSDictionary structure this framework exposes and is not perfect. Please heavily test your app if you use this library to edit metadata, a set of test images for tests can be found in the example app (currently testing around 216 keys out of 314 supported on iOS 10.2). This library DOES NOT garantee data integrity like libexif or exiv2 would.

Screenshots

Metadata copy

Metadata editing

Data set analysis

Metadata preview

Credits

You’ll find links that helped me a lot in comments inside this library where appropriate. Mainly:

Credits to chrfb (http://chrfb.deviantart.com) for the beautiful icons I used in the tab buttons.

License

Use it as you like in every project you want, redistribute with mentions of my name and don’t blame me if it breaks :)

— dvkch

Latest podspec

{
    "name": "SYPictureMetadata",
    "platforms": {
        "ios": "7.0",
        "tvos": "9.0"
    },
    "version": "1.4.3",
    "license": "Custom",
    "summary": "Easy access to EXIF metadata of an image",
    "homepage": "https://github.com/dvkch/SYPictureMetadata",
    "authors": {
        "Stan Chevallier": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dvkch/SYPictureMetadata.git",
        "tag": "1.4.3"
    },
    "source_files": "SYPictureMetadata/*.{h,m}",
    "requires_arc": true,
    "xcconfig": {
        "CLANG_MODULES_AUTOLINK": "YES"
    },
    "dependencies": {
        "Mantle": []
    },
    "ios": {
        "frameworks": [
            "ImageIO",
            "AssetsLibrary"
        ]
    },
    "tvos": {
        "frameworks": [
            "ImageIO",
            "AssetsLibrary"
        ]
    },
    "module_name": "SYPictureMetadata"
}

Pin It on Pinterest

Share This