Open stanmots opened 8 years ago
@storix Thanks for your great work! As it involve quite a lot of changes, I need time to study and validate your code before merging it to master. Hope you don't mind.
@storix I am very busy on my personal matter so I have no time to verify your improvement yet. This PR might not be merged within short period of time.
@chiunam It's ok. I understand.
By the way, I have made a few important changes to this feature: iOS 8 support is dropped because of the inefficiency of GIF type detection (just to know whether a current asset is GIF we must download the full-sized image data); and the entire feature is now optional with the help of CocoaPods subspec settings. So the code now is much more readable and clean.
To put it in simple words: when the users have a podfile edited like this:
platform :ios, '9.0'
pod 'CTAssetsPickerController', '~> 3.3.0'
GIF support is disabled and all the dependencies required for this feature to work are not compiled.
To enable this feature we must add to the podfile the following line:
pod 'CTAssetsPickerController/GIF', '~> 3.3.0'
That's it. With one-line addition all GIFs will be playable. And, as you might expect, to disable GIF support this line must be deleted.
Latest changes:
FLAnimatedImage
engine for GIF playing is replaced with the YYImage
framework so that support for the additional animated image formats (such as WebP and APNG) can be enabled in the future.Sorry, development of this project is suspended. This PR would be merged.
The feature for playing animated images (GIFs) in full-screen preview was implemented with the help of FLAnimatedImage high performance engine. You can find the details in the code comments.
Note: If you would like to merge this feature don't forget to run pod install to resolve the new dependency (FLAnimatedImage).
Basic usage:
You can enable/disable this feature by using a new property allowsAnimatedImages as shown in the next code sample:
CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init]; picker.allowsAnimatedImages = YES;
Result: