How to save gif in my photo album?

I tried using UIImageWriteToSavedPhotosAlbum and ALAssetsLibrary to save my gif to a photo album. But when I try to send an email, it does not come to life. I am sure that metadata is lost when it is saved. Does anyone know how I can save gif metadata?

thank

+4
ios objective-c iphone
Feb 26 '13 at 0:35
source share
1 answer

Pretty old question, but it can help someone!

I use this code to save GIFs in a photo album, and it works fine, verified by opening GIFs in MailViewComposer and iMessage.

ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; NSData *data = [NSData dataWithContentsOfFile:tempPath]; // Your GIF file path which you might have saved in NSDocumentDir or NSTempDir [library writeImageDataToSavedPhotosAlbum:data metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) { if (error) { NSLog(@"Error Saving GIF to Photo Album: %@", error); } else { // TODO: success handling NSLog(@"GIF Saved to %@", assetURL); success(tempPath); } }]; 
+4
Jul 27 '14 at 22:58
source share



All Articles