简体   繁体   English

使用自定义名称将照片保存到iphone相机胶卷

[英]Save photo to iphone camera roll with a custom name

I am trying to save a photo taken from my app to camera roll, this can be done by using UIImageWriteToSavedPhotosAlbum, however, I noticed there isn't any way to set the photo name by using this approach, am I right? 我试图将从我的应用程序拍摄的照片保存到相机胶卷,这可以通过使用UIImageWriteToSavedPhotosAlbum来完成,但是,我注意到没有任何方法通过使用这种方法设置照片名称,我是对的吗?

I also tried to save a image file with a name by using UIImageJPEGRepresentation, however, I can only save it to my app's document folder but not camera roll. 我还尝试使用UIImageJPEGRepresentation保存带有名称的图像文件,但是,我只能将其保存到我的应用程序的文档文件夹而不是相机胶卷。

Is there any way to save photo to camera roll with a custom name? 有没有办法用自定义名称将照片保存到相机胶卷?

Thanks advance for your kindly help. 感谢您的亲切帮助。

John 约翰

不,无法使用自定义名称保存到相机胶卷。

There is a way to kinda do that, by setting the image metadata: 通过设置图像元数据,有一种方法可以做到这一点:
if you set the IPTC metadata field "Object Name", this will be shown as the image title in iPhoto. 如果您将IPTC元数据字段设置为“对象名称”,则它将在iPhoto中显示为图像标题。

See details (and code) at http://ootips.org/yonat/how-to-set-the-image-name-when-saving-to-the-camera-roll/ . 请参阅http://ootips.org/yonat/how-to-set-the-image-name-when-saving-to-the-camera-roll/上的详细信息(和代码)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM