作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
CGImageProperties.h
列出了一组用于指定 EXIF 和 IPTC 元数据的键。我可以成功地为 JPEG 图像设置 EXIF 元数据:
- (NSData*)imageDataForImage:(UIImage*)image {
NSDictionary *metadata = @{kCGImagePropertyExifDictionary: @{(NSString*)kCGImagePropertyExifLensModel: @"my lens"}};
NSData* rawImageData = UIImageJPEGRepresentation(image, 1.0f);
NSMutableData *imageData = [NSMutableData data];
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef) rawImageData, NULL);
CGImageDestinationRef destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, kUTTypeJPEG, 1, NULL);
CGImageDestinationAddImageFromSource(destination, source, 0, (__bridge CFDictionaryRef) metadata);
CGImageDestinationFinalize(destination);
CFRelease(source);
CFRelease(destination);
return imageData;
}
但是,我不知道如何指定 XMP 元数据,特别是 XMP.GPano键。我试过这样的字典:
@{@"XMP": @{@"GPano": @{@"PosePitchDegrees": @20}}}
但它只是被忽略了。这甚至可以使用 Core Graphics 吗?
最佳答案
您可以为此使用 XMP SDK。这是一个强大的跨平台解决方案(实际上由 Apple 内部使用)。
关于ios - 如何在 iOS 中设置 XMP 图像元数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37522317/
我是一名优秀的程序员,十分优秀!