agap / picassos3 Goto Github PK
View Code? Open in Web Editor NEWPicassoS3 - the Picasso's Downloader implementation which allows you to download images stored on Amazon S3 and secured by AWS IAM
PicassoS3 - the Picasso's Downloader implementation which allows you to download images stored on Amazon S3 and secured by AWS IAM
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.