Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

PHAsset GIF support #41

Closed
chadpod opened this issue Aug 6, 2015 · 5 comments
Closed

PHAsset GIF support #41

chadpod opened this issue Aug 6, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@chadpod
Copy link

chadpod commented Aug 6, 2015

More of a question than a bug, but are GIFs supported for PHAssets or just remote resources loaded via url? I ended up inspecting the UTI in the info dictionary and then loading the GIF as data with the standard -[PHImageManager requestImageDataForAsset:options:resultHandler:]. Thanks and nice framework ... can't believe I hadn't seen it till now.

@kean
Copy link
Owner

kean commented Aug 7, 2015

are GIFs supported for PHAssets or just remote resources loaded via url?

GIFs (as well as webp) are supported just for remote resources. _DFPhotosKitImageFetchOperation uses -requestImageForAsset:targetSize:contentMode:options:resultHandler: under the hood. Changing it to use -[PHImageManager requestImageDataForAsset:options:resultHandler:] and built-in image decoder should be just couple of lines of code. Thanks for feedback, I'll take a look into it.

@kean kean added the feature label Aug 8, 2015
@kean kean added this to the 0.7.0 milestone Aug 9, 2015
@kean
Copy link
Owner

kean commented Aug 9, 2015

DFImageFetching should probably return NSData instead of UIImage (DFImageDataFetching). It was returning UIImage because of the AssetsLibrary that doesn't provide access to NSData of thumbnail and fullScreenImage. It might be worth to either simply drop AssetsLibrary support or reimplementing it to work with fullsize image data.

@kean kean self-assigned this Aug 10, 2015
@kean
Copy link
Owner

kean commented Aug 10, 2015

  • Image fetchers (classes conforming to DFImageFetching protocol) are now required to fetch image data (NSData) instead of UIImage, they do not decode data
  • Image decoding is now handled by DFImageManager itself

DFPhotosKitImageFetcher:

  • DFPhotosKitImageFetcher has a completely new goal now. It no longer tries to mimic PHImageManager as close as possible. Instead it now extends PHImageManager functionality by providing custom image decoding which includes GIF support. As a downside, it is slower when it comes to image previews, however that’s no longer a goal; if the user wants performance as fast as Photos app he should use PHImageManager directly anyway
  • Remove DFPhotosKitDeliveryModeKey and DFPhotosKitResizeModeKey which are no longer used

DFURLImageFetcher:

  • Rename DFURLResponseDeserializing to DFURLResponseValidating; change classes conforming to this protocol accordingly
  • Remove DFURLImageDeserializer

DFAFImageFetcher:

  • Remove DFAFImageDeserializer, use AFHTTPResponseSerializer instead

@kean
Copy link
Owner

kean commented Aug 10, 2015

Overall, these changes lead to much cleaner implementation. And it enables much cleaner progressive JPEG implementation.

@kean
Copy link
Owner

kean commented Aug 10, 2015

Done in develop branch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants