Coder Social home page Coder Social logo

Comments (5)

dreampiggy avatar dreampiggy commented on June 4, 2024

@anmolagar Hi. Thanks for the report.

The Photos Plugin is just a loader, to load the normal UIImage stored in the iOS device photos library. Therefore the image in the completionBlock is always actually the UIImage class but not something like SDAnimatedImage for animation.

Could you please help me provide some extra information ? For example, how do you register the Photos Loader during image loading ? Did you assign it into the shared manager to using the context option to just use a single manager ?

SDWebImageManager *manager = [[SDWebImageManager alloc] initWithCache:SDImageCache.sharedCache loader:SDWebImagePhotosLoader.sharedLoader];
[imageView sd_setImageWithURL:photosURL placeholderImage:nil context:@{SDWebImageCustomManager: manager}];

And, could you please add a completionBlock for sd_setImageWithURL: method, in the completionBlock, check the image arg, is that valid ?

[cell.customImageView sd_setImageWithURL:self.objects[indexPath.row]
                        placeholderImage:placeholderImage
                                 options:SDWebImageFromLoaderOnly
                                 context:@{SDWebImageContextStoreCacheType : @(SDImageCacheTypeNone)}
                                progress:nil
                               completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
                                     // Debug or log to check whether the image is valid ?
                                     NSParameterAssert(image);
                                 }];

from sdwebimagephotosplugin.

dreampiggy avatar dreampiggy commented on June 4, 2024

@anmolagar Our demo also use SDAnimatedImageView, could you try to clone and modify the code to simulate your use case, and test whether this issue can be reproduced ?

from sdwebimagephotosplugin.

anmolagar avatar anmolagar commented on June 4, 2024

Hi @dreampiggy ,
My project has both the use case of getting images from Photo library as well as getting from the web. So I am wondering, could this be a conflicting scenario?

from sdwebimagephotosplugin.

dreampiggy avatar dreampiggy commented on June 4, 2024

@anmolagar See the readme again. I update the step-by-step tutorial about how to register loader for SDWebImageManager based on two different use cases.

https://github.com/SDWebImage/SDWebImagePhotosPlugin#usage

Actually it's not so magic, you should use the loader manager (multiple loaders) to register both SDWebImageDownloader && SDWebImagePhotosLoader, then all things done :)

from sdwebimagephotosplugin.

stale avatar stale commented on June 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from sdwebimagephotosplugin.

Related Issues (14)

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.