Giter Site home page Giter Site logo

dfimagemanager's Introduction

dfimagemanager's People

Contributors

adlai-holler avatar bassrock avatar camobap avatar hamzaghazouani avatar holgersindbaek avatar jeffreyjackson avatar kean avatar vox-humana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dfimagemanager's Issues

Is it possible to empty the cache?

My app loads a new image every couple of seconds, and I would like to preload into cache a couple of images in advance. I'm worried this might over use the memory.
Does DFImageManager supports a manual way to empty the cache?

You've created a very useful and powerful lib. Thank you!

sometimes empty image

hello

i am in the process of porting to DFImageManager from SDWebImage :) - one of the main reason, the GIF support.

right now i have a few collectionviews (inside uitabbarcontroller) each with a bunch of cells (mtl.image is DFImageView).

doing something like

[mtl.image prepareForReuse];
[mtl.image setAllowsAnimations:NO];
[mtl.image setImageWithResource:[NSURL URLWithString:obj.imageUrl]];

loading the same datasource, into two tabs (collection views) - sometimes does not load images in one collectionview, and in the other it does (mainly on GIFS), i have no clue where to start debugging, any hints?

regards
helmut

Better DFImageTaskCompletion completion block

Changes to completion block:

  • Remove user info dictionary
  • Add error argument
  • Add DFImageResponse (new class) argument
  • Add DFImageTask argument

Completion block should follow simple rules:

  • If there is an error, there is no image and no response
  • If there is no image and no response, there is always an error

Other changes:

  • DFImageFetching protocol and DFImageManagerImageLoader should no longer use DFImageResponse class
  • Add public response (DFImageResponse) property to DFImageTask
  • Update DFCompositeImageTaskImageHandler to reflect DFImageTaskCompletion changes
  • Update DFImageView interface to reflect DFImageTaskCompletion changes

These changes would allow for better compiler checks, better discoverability of APIs and better performance.

Add -resume method to DFImageTask

  • Add -resume method to DFImageTask, tasks should not start automatically. This change would enable some new use cases
  • Add -imageTaskWithRequest:completion: and -imageTaskWithResource:completion: methods to DFImageManaging protocol
  • Make -requestImageForRequest:completion: and -requestImageForResource:completion: methods deprecated

AFNetworking Integration

DFImageManager should have a single responsibility of providing a great API for managing image requests (and that's a lot of work). Users should be able to easily plug-in everything else. That's the way the GIF support was implemented in version 0.1 - as a subspec that integrated FLAnimatedImage. That's how the networking should be implemented - as a subspec that integrates AFNetworking with all its goodness. AFNetworking should be a primary option for networking, but DFImageManager will still have it's basic, extensible networking implementation.

df_setImageWithResource: with nil url crashes the application

DFImageManagerKit+UI.h


[self.imageViewIcon df_setImageWithResource:[NSURL URLWithString:data.imageUrl]];


Crashes here:

- (DFImageTask *)imageTaskForRequest:(DFImageRequest *)request completion:(DFImageRequestCompletion)completion {
    id<DFImageManaging> manager = DFManagerForRequest(request);
    if (!manager) {
        [NSException raise:NSInvalidArgumentException format:@"There are no managers that can handle the request %@", request];
    }
    return [manager imageTaskForRequest:request completion:completion];
}

Not really a bug, as I passed nil instead of NSURL, but still I think crashing is not the best choice.

DFImageRequestID ~> DFImageTask

  • Rename DFImageRequestID to DFImageTask (similar to Nuke)
  • Open some of the private _DFImageTask interfaces like state, request, error, completionHandler etc
  • Rename DFImageInfoRequestIDKey to DFImageInfoTaskKey

Background image download

is it possible to supply a 100 images may be which the app keeps fetching and storing in the cache even when the app goes to background?

Add GIF support

Use FLAnimatedImage.
Preferably wait for version 2.0, when they make FLAnimatedImage into a UIImage subclass (branch is in active development). Otherwise do it using DF classes.

CocoaPods and dynamic frameworks

This currently will not build if included in a dynamic framework via CocoaPods. The issue appears to be with importing FLAnimatedImage in DFImageView.h. It throws an error on line 27 with "'FLAnimatedImage.h' file not found."

Download GIF first frame only

DFImageRequestOptions could contain an option GIFFirstFrameOnly
which downloads only the first GIF frame

for situation, if you want to have a play button on GIF and display the first frame placeholder

(optional, in the progressHandler you could retrive the first frame once available)

Make image tasks pausable

  • Add -pause method to DFImageTask
  • DFImageManager should be able to put tasks back into suspended state
  • Add optional pause to the operation, returned by DFImageFetching protocol. Waiting for #29
  • Make NSProgress pausable
  • Support pause in image fetchers

tap event

could you plz add a tap event to the image,
and if we can view them and share them it will be great

DFImageView and Aspect Fit

Aspect fit doesn't appear to be working properly when setting a DFImageView's image using setImageWithRequest: and the request's contentMode set to DFImageContentModeAspectFit. Mine are doing a fill instead.

Refactor DFImageManager to make it more approachable

Move some functionality out of DFImageManager. Create a separate class to control image loading that should:

  • Enable transparent image loading+processing+caching with a single completion handler
  • Transparent multiplexing from one fetch operation to multiple image tasks
  • Offload work to its own background queue

Improve DFCompositeImageManager dispatch logic for preheating requests

This is how it works right now:

- (void)startPreheatingImagesForRequests:(nonnull NSArray *)requests {
    for (DFImageRequest *request in requests) {
        [DFManagerForRequest(request) startPreheatingImagesForRequests:@[request]];
    }
}

Composite image manager should use a dispatch table instead.

Transparent memory caching

DFImageManager's memory cache fast path should be completely transparent to the clients:

  • Methods requestImageForRequest:completion: and requestImageForResource:completion: should always return requestID
  • requestID should be added to the info dictionary in the completion block
  • Rename DFCachedImage to DFCachedImageResponse which should store now only response image, but response metadata too
  • Response metadata should be added to the info dictionary in the completion block

DFImageView animation

I'm using a DFImageView with a default image in a UICollectionViewCell, then calling setImageWithResource: to fetch a remote image. Is the new image transition suppose to animate? I'm assuming that's what the allowsAnimations property is for, which says default is YES. But the image change is very abrupt.

Caching across app launches

I'm using a DFImageView in a UICollectionViewCell and calling the setImageWithResource: method. The caching seems to work as long as my app is open, but every time I restart the app it downloads the images again remotely. Is there some additional configuration needed to make the cache persist across app launches?

Refactor DFImageFetchTask

Completely redesign DFCompositeImageTask (previous DFImageFetchTask)

  • Simplify image handler logic, add separate completion handler
  • Initialize DFCompositeImageTask with image tasks (instances of DFImageTask class), not requests
  • Add a class method that would automatically create image tasks for a given requests and then create a composite task from them
  • Rename DFImageFetchTask to DFCompositeImageTask, since we now have DFImageTask
  • Remove DFImageFetchContext, use new DFImageTask properties instead; Remove contextForRequest: method
  • Remove startTime and elapsedTime from DFCompositeImageTask
  • Fully cover DFCompositeImageTask by unit tests

PHAsset GIF support

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.