GithubHelp home page GithubHelp logo

Comments (3)

lexs avatar lexs commented on May 25, 2024

I'm not sure what you want the use case is, showing the images inside a ViewPager would still require them loaded into memory? Please describe the use case in more detail, there may be a simpler way of solving it. One thing I want to do is support "flags" saying to do stuff like skip memory cache, or don't cache intermediate transformations etc.

Anyways, returning the File instead of Bitmap is hard because of two things.
1). The code which handles disk caching (DiskLruCache) doesn't have a method to expose the File, probably due to 2.
2). Even if a File was returned there is no guarantee that it will be there when you try to read it, another image may have triggered a purge of this image. concurrency is tricky that way.

Also, you won't always even have a disk cache.

from webimageloader.

arnaudbos avatar arnaudbos commented on May 25, 2024

Sure, didn't think about the concurrency that way... The idea behind this "issue" opening was to use some sort of view holder pattern inside the view pager to load the image only when needed.
I guess a FragmentStatePagerAdapter would be more suitable, I don't know.

from webimageloader.

lexs avatar lexs commented on May 25, 2024

I think this could be handled by simple doing the load when the actual fragment is shown instead of when it's created.

Even if you could retrieve a File, note that loading a bitmap from it is still a blocking operation.

from webimageloader.

Related Issues (20)

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.