1and2papa / CTAssetsPickerController

iOS control that allows picking multiple photos and videos from user's photo library.
MIT License
2.15k stars 550 forks source link

Implementation of the feature for playing GIFs in full-screen preview #211

Open stanmots opened 8 years ago

stanmots commented 8 years ago

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:

animatedimagesfeaturepreview

1and2papa commented 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.

1and2papa commented 8 years ago

@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.

stanmots commented 8 years ago

@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.

stanmots commented 8 years ago

Latest changes:

1and2papa commented 8 years ago

Sorry, development of this project is suspended. This PR would be merged.