简体   繁体   English

iOS从UIImagePickerController选择图像保存gif图像

[英]IOS save gif image from UIImagePickerController selected image

I am creating an app in which I need to copy image from IOS Photo library to the app's Document directory and then upload the file to the server. 我正在创建一个应用程序,在该应用程序中,我需要将图像从IOS照片库复制到应用程序的“文档”目录,然后将文件上传到服务器。 I'm using the UIImagePickerController to select the image from the Photo library and save it in the app folder. 我正在使用UIImagePickerController从照片库中选择图像并将其保存在app文件夹中。 It works good for the "jpeg" and "png" images using UIImageJPEGRepresentation and UIImagePNGRepresentation. 使用UIImageJPEGRepresentation和UIImagePNGRepresentation可以很好地处理“ jpeg”和“ png”图像。

I don't see any option to copy and save the "gif" images in IOS. 我没有看到任何在IOS中复制和保存“ gif”图像的选项。 Is it possible to save the animated gif images. 是否可以保存动画的gif图像。 Please throw some light on how to process and save the original images (bmp, jpg, gif, png, tiff, etc.,). 请说明如何处理和保存原始图像(bmp,jpg,gif,png,tiff等)。

Thanks in advance. 提前致谢。

While you can load them (though you need to split them up for animations; Add animated Gif image in Iphone UIImageView - note the convert command near the bottom) one cannot save them. 虽然可以加载它们(尽管您需要将它们拆分为动画; 在Iphone UIImageView中添加动画Gif图像 -请注意底部附近的convert命令),但无法保存它们。

To save them you'll need to use a third party library. 要保存它们,您需要使用第三方库。

See this question, How to save a GIF on the iPhone? 看到这个问题, 如何在iPhone上保存GIF? , and this http://jitsik.com/wordpress/?p=208 library for a solution. ,以及用于解决方案的http://jitsik.com/wordpress/?p=208库。

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

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