- (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,(__brIDge CFDictionaryRef) Metadata); CGImageDestinationFinalize(destination); CFRelease(source); CFRelease(destination); return imageData;}
但是,我想知道如何指定XMP元数据,特别是XMP.GPano键.我试过这样的字典:
@{@"XMP": @{@"GPano": @{@"PosePitchdegrees": @20}}}
但它完全被忽略了.这甚至可以使用Core Graphics吗?
解决方法 您可以使用XMP SDK.它是一个强大的跨平台解决方案(实际上由Apple内部使用). 总结以上是内存溢出为你收集整理的如何在iOS中设置XMP图像元数据?全部内容,希望文章能够帮你解决如何在iOS中设置XMP图像元数据?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)