我想從照片中獲得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