我想从照片中获得exif。我如何做到最佳?如何从照片中获得exif?
NSData *dataOfImageFromGallery = UIImageJPEGRepresentation (workingImage,0.5);
CGImageSourceRef imageSource;
imageSource = CGImageSourceCreateWithData((__bridge CFDataRef)dataOfImageFromGallery, NULL);
if (imageSource == NULL) {
// Error loading image ...
return; }
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], (NSString *)kCGImageSourceShouldCache, nil];
CFDictionaryRef imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, (__bridge CFDictionaryRef)options);
if (imageProperties) {
NSNumber *width = (__bridge NSNumber *)CFDictionaryGetValue(imageProperties, kCGImagePropertyPixelWidth);
NSNumber *height = (__bridge NSNumber *)CFDictionaryGetValue(imageProperties, kCGImagePropertyPixelHeight);
CFRelease(imageProperties);
NSLog(@"width: %@", width);
NSLog(@"height: %@", height);
}
本刊width
和height
但EXIF属性是CGImageProperties.h
约40 ImageIO.h
库文件,我不知道怎么一下子打印。
我不明白。我必须写这个函数。你给我你的应用程序。 – 2012-01-09 18:30:55
对不起,我的项目基于exiftool http://owl.phy.queensu.ca/~phil/exiftool/ – SAKrisT 2012-01-09 19:38:52