Last active
August 29, 2015 13:59
-
-
Save MartinJNash/10489675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALAssetRepresentation *rep = [asset defaultRepresentation]; | |
NSDictionary *dict = [rep metadata]; | |
NSString *xmp = dict[@"AdjustmentXMP"]; | |
NSData *xmpData = [xmp dataUsingEncoding:NSUTF8StringEncoding]; | |
NSError *e = nil; | |
NSArray *filters = [CIFilter filterArrayFromSerializedXMP:xmpData inputImageExtent:CGRectZero error:&e]; | |
CIFilter *filter = [filters firstObject]; | |
CIImage *image =[CIImage imageWithCGImage: [rep fullScreenImage]]; | |
[filter setValue:image forKey:kCIInputImageKey]; | |
CIImage *outputImage = [filter outputImage]; | |
UIImage *filteredImage = [UIImage imageWithCIImage:outputImage]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment