复制使用UiimagePicker选择的照片和元数据,并带有修改的Exif Metadata的新照片
我希望能够使用 UIImagePicker 从照片库中选择一张照片,并将所有图像(带有修改后的 Exif 元数据)复制到我保存在“照片”中的新照片中。如果我使用 UIActivityViewController 选择保存选项(从复制/保存/分配到联系人/打印/添加到共享相册/保存到文件),则当我从加载的图像数据创建新的 UIimage 时,不会传输输入图像元数据修改后的元数据。如何获取附加到已保存照片的修改过的元数据的图像?
I would like to be able to select a photo from the Photos library using UIImagePicker and copy all the image (with modified Exif metadata) to a new photo which I save in Photos. If I use UIActivityViewController to choose the save option (from copy/save/assign to contact/print/add to shared album/save to file), the input image metadata is not transferred when I create a new UIimage from the loaded image data with the modified metadata. How can get the image with modified metadata attached to the saved photo?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终找到了如何做到这一点。图像选择器之后执行的代码如下。重要的是创建从 URL 提取元数据的源,而不是从 image.jpegData 的数据中提取元数据。 jpegData 选项仅包含 JPEG 操作必需的元数据
}
返回零
获取newData
后,保存按钮IBAction为,
将图片保存到与所选图片同一个相册的函数为
Eventually found out how to do this. The code executed after the image picker is below. The important thing is to create the source from which the metadata is extracted from a URL, not from data from image.jpegData. The jpegData option only includes metadata essential to JPEG operation
}
return nil
}
After obtaining newData, the save button IBAction is
and the function to save the image in the same album as the selected image is