HJImagesToGIF
HJImagesToGIF copied to clipboard
Save to Photo Album not working
I use the given method for saving GIF to photo album, but it does not animate when i attach the GIF to an email or iMessage. So i instead used below code which seems to work fine for me:
instead of:
UIImage * gif_image = [UIImage imageWithContentsOfFile:tempPath];
UIImageWriteToSavedPhotosAlbum(gif_image, self, nil, nil);
I used:
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
NSData *data = [NSData dataWithContentsOfFile:tempPath];
[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);
}
}];
This seems to work.
But one problem remains, When I attach it to email or iMessage, works fine. But not for sharing on twitter.
as you can see in the screen shot: the keyboard images are GIFs, but twitter does not show them as GIFs (which you can see in Dog GIF there is a 'GIF' label on top left).
What might be the problem?