Skip to content

IHEARTCOOKIES/XMPFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo XMPFramework is a simple Objective-C++ wrapper on top of Adobe XMP ToolKit that allow for a native API similar to NSUserDefaults to read/write XMP data.

CI Status Version License Platform

Installation

The quickest way to get up and running would be through the use of cocoapods. Simply add the following line to your Podfile:

pod 'XMPFramework'

Usage

Reading XMP Data

To read XMP data, simply instantiate an instance of XMPReader with the path to the file in mind. You should feel right at home with XMPFramework since most of the APIs are very similar to NSUserDefaults class.

XMPReader *reader = [[XMPReader alloc] initWithFilePath:pathToFile];
NSString *output = [reader stringForKey:@"SomeXMPMetadataKey"];

Writing XMP Data

You have two choices in writing XMP data. You could either instantiate a XMPWriter instance and write data using the traditional set: APIs.

XMPWriter *writer = [[XMPWriter alloc] initWithFilePath:pathToFile];
BOOL writeSuccessful = [writer setString:@"SomeString" forKey:@"SomeKey"];
BOOL syncSuccessful = [writer synchronize]; // synchronizes the changes

To write multiple bits of data, it's preferred to do this using a XMPBatchWriter instance.

XMPBatchWriter *writer = [[XMPBatchWriter alloc] initWithFilePath:pathToFile];
[writer setDictionary:@{
   @"SomeKeyA":@"SomeStringA",
   @"SomeKeyB":@"SomeStringB"
}];
BOOL syncSuccessful = [writer synchronize]; // synchronizes the changes

For more concrete examples of writing XMP data (using properties, namespace URI, etc.), see the Tests.m file located in the Tests directory.

Requirements

Runs on iOS 8.0+, 64 bit and above. 32 bit is not supported by Adobe XMP ToolKit.

Who created it?

XMPFramework was authored by Filip Busic (the guy who likes cookies). Feel free to shoot a message to the author via Twitter if you have any questions or ideas on how to make XMPFramework better.

License

XMPFramework is available under the MIT license. The underlying component, Adobe XMP ToolKit, that makes this framework possible runs on BSD. See the LICENSE file for more info.

About

An Objective-C++ wrapper on top of Adobe's XMP ToolKit for reading/writing XMP data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published