如何在iOS中设置XMP图像元数据?

如何在iOS中设置XMP图像元数据?,第1张

概述CG ImageProperties.h列出了一组用于指定EXIF和IPTC元数据的键.我可以成功为JPEG图像设置EXIF元数据: - (NSData*)imageDataForImage:(UIImage*)image { NSDictionary *metadata = @{kCGImagePropertyExifDictionary: @{(NSString*)kCGImagePr CG ImagePropertIEs.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,(__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图像元数据?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1003038.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存