GithubHelp home page GithubHelp logo

agap / picassos3 Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 42 KB

PicassoS3 - the Picasso's Downloader implementation which allows you to download images stored on Amazon S3 and secured by AWS IAM

Java 100.00%

picassos3's People

Contributors

agap avatar sunwicked avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sunwicked

picassos3's Issues

Doesn't load from disk.

Your disk cache has a bug.

public InputStream get(@nonnull final Uri uri)

Closes the input stream before Picasso can decode the bitmap.

You need to remove snapshot.close() in the finally clause for this to work.

Image is only downloading at very first time but not next times

after adding your library to my project i use below code snippet

new Picasso.Builder(MainActivity.this).downloader(new S3Downloader(MainActivity.this, s3Client, bucket))
.build()
.load("https://s3-eu-east-5.amazonaws.com/music/Music_3.jpg")
.noFade()
.placeholder(R.drawable.img_placeholder)
.memoryPolicy(MemoryPolicy.NO_CACHE)
.networkPolicy(NetworkPolicy.NO_CACHE)
.into(imageView);

with above code snippet image is loading in imageview but it works only first time after installing app and after that it's not loading the url image.

Incorrect way to handle completed.

Unfortunately you are handling the removal of the latch incorrectly by placing this line:

if (bytesCurrent == bytesTotal)

in onProgressChanged. This won't work correctly because sometimes the initial call by the Transfer manager gives the total as 0 out of 0 bytes which in turn means you are removing the latch and returning a file of 0 bytes in size, even though the download has not completed, which in turn causes Picasso to either retry the download or fail, depending on how fast the retry is.

You need to handle the latch countdown in onStateChanged(). This method reports when the download has completed or has been cancelled.

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.