【发布时间】:2014-06-19 21:33:35
【问题描述】:
我正在尝试从图像中提取 exif 信息。
UIImage *pImage = [UIImage imageNamed:@"IMG_0011.JPG"];
NSData* pngData = UIImageJPEGRepresentation(pImage, 1.0);
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)pngData, NULL);
NSDictionary *metadata = (__bridge NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source, 0, NULL);
NSLog(@"exif %@" , metadata);
我得到了以下元数据信息
exif {
ColorModel = RGB; <br>
Depth = 8; <br>
Orientation = 1; <br>
PixelHeight = 1936;<br>
PixelWidth = 2592;<br>
"{Exif}" = {
ColorSpace = 1;<br>
PixelXDimension = 2592;<br>
PixelYDimension = 1936;<br>
};
"{JFIF}" = {<br>
DensityUnit = 0;<br>
JFIFVersion = (<br>
1,<br>
1<br>
);
XDensity = 1;<br>
YDensity = 1;<br>
};
"{TIFF}" = {<br>
Orientation = 1;<br>
};
}<br>
但是当我使用 exif 数据查看器或预览应用程序检查图像时,我得到了以下信息。
Aperture Value: 2.526<br>
Brightness Value: 1.897<br>
Color Space: sRGB<br>
Components Configuration: 1, 2, 3, 0<br>
Date Time Digitized: 20-Dec-2013 1:33:31 PM<br>
Date Time Original: 20-Dec-2013 1:33:31 PM<br>
Exif Version: 2.2.1<br>
Exposure Mode: Auto exposure<br>
Exposure Program: Normal program<br>
Exposure Time: 1/15<br>
Flash: No flash function<br>
FlashPix Version: 1.0<br>
FNumber: 2.4
Focal Length: 4.28<br>
Focal Length In 35mm Film: 35<br>
ISO Speed Ratings: 125<br>
Metering Mode: Pattern<br>
Pixel X Dimension: 2,592<br>
Pixel Y Dimension: 1,936<br>
Scene Capture Type: Standard<br>
Sensing Method: One-chip color area sensor<br>
Shutter Speed Value: 3.907
Subject Area: 1295, 967, 699, 696
White Balance: Auto white balance<br>
Regions: {
HeightAppliedTo = 1936;<br>
RegionList = (
{
ConfidenceLevel = 326;<br>
FaceID = 3;<br>
Height = "0.172";<br>
Timestamp = 956449648;<br>
Type = Face;<br>
Width = "0.128";
X = "0.542";<br>
Y = "0.426";<br>
}
);
WidthAppliedTo = 2592; <br>
}
有什么建议如何在 ios 上提取完整的 exif 数据 ....?
【问题讨论】:
标签: ios cocoa-touch image-processing ios7 exif