Coder Social home page Coder Social logo

Comments (6)

dreampiggy avatar dreampiggy commented on June 4, 2024 1

@BharatAgarSoftTech My typo. Use [SDImageCache sharedImageCache] && SDWebImageContextCustomManager in Objective-C. I updated the readme as well.

from sdwebimagephotosplugin.

BharatAgarSoftTech avatar BharatAgarSoftTech commented on June 4, 2024

I just add below three files inside my project and pushing to MasterViewController
MasterViewController.xib
MasterViewController.h
MasterViewController.m

info.plist information
Allow Arbitrary Loads YES
Privacy - Photo Library Usage Description is added

padlock info

  • SDWebImage/Core (5.0.0-beta3)
  • SDWebImagePhotosPlugin (0.1.0):
    • SDWebImage/Core (~> 5.0.0-beta)

from sdwebimagephotosplugin.

dreampiggy avatar dreampiggy commented on June 4, 2024

@BharatAgarSoftTech Hi. From the NSURLErrorDomain, it seems that the SDWebImagePhotosLoader was not registered to your SDWebImageManager during image loading. By default it use SDWebImageDownloader and supports HTTP/HTTPS/FTP image URLs only.

I update the readme and introduce detailed step by step tutorial for beginners. You can try to look at SDWebImagePhotosPlugin-Usage again.

If still have some issue, you can also run our demo to check is there anything wrong with your code or the configuration. Waiting for response.

from sdwebimagephotosplugin.

BharatAgarSoftTech avatar BharatAgarSoftTech commented on June 4, 2024

@dreampiggy Thanks for quick reply.

Right now i am changing default image loader to PhotosLoader using below code
SDWebImageManager.defaultImageLoader = [SDWebImagePhotosLoader sharedLoader];

And loading image like this.
[cell.customImageView sd_setImageWithURL:self.objects[indexPath.row]
placeholderImage:placeholderImage
options:SDWebImageFromLoaderOnly
context:@{SDWebImageContextStoreCacheType : @(SDImageCacheTypeNone)}];

When I tried to use SDImageCache and SDWebImageCustomManager its showing following errors.
Property 'sharedCache' not found on object of type 'SDImageCache'
Use of undeclared identifier 'SDWebImageCustomManager'

from sdwebimagephotosplugin.

BharatAgarSoftTech avatar BharatAgarSoftTech commented on June 4, 2024

@dreampiggy Thanks for the support its working now :)

Here is the working code

// Setup Photos Loader
SDWebImageManager.defaultImageLoader = [SDWebImagePhotosLoader sharedLoader];

// Setup Manager
SDWebImageManager *manager = [[SDWebImageManager alloc] initWithCache:SDImageCache.sharedImageCache loader:SDWebImagePhotosLoader.sharedLoader];

// Loading image
[cell.customImageView sd_setImageWithURL:self.assetArray[indexPath.row] placeholderImage:nil options:SDWebImageFromLoaderOnly context:@{SDWebImageContextCustomManager: manager}];

from sdwebimagephotosplugin.

dreampiggy avatar dreampiggy commented on June 4, 2024

@BharatAgarSoftTech That first line of code, will effect shared SDWebImageManager to use Photos loader only. So when you load HTTP URLs using sd_setImageWithURL: without using that SDWebImageContextCustomManager context option, you will get error because you disable SDWebImageDownloader.

The correct way, is to assign the SDImageLoadersManager into defaultImageLoader. It's a multiple loaders manager. You can supply one or more actual loaders into its' loaders array.

// Supports HTTP URL as well as Photos URL globally
SDImageLoadersManager.sharedManager.loaders = @[SDWebImageDownloader.sharedDownloader, SDWebImagePhotosLoader.sharedLoader];
// Replace default manager's loader implementation
SDWebImageManager.defaultImageLoader = SDImageLoadersManager.sharedManager;

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.