Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Picasso Load image from filesystem

Can I use Picasso library to load images from the filesystem?

I'm using startActivityForResult to let the user pick a photo from his gallery, and then want to show the selected image.

I already have working code to get the image filesystem Uri, but can't get the Picasso.load() method to work.

like image 781
edrian Avatar asked May 15 '14 14:05

edrian


People also ask

How will you load an image into an imageView from an image URL using Picasso?

Image loading using Picasso is very easy, you can do it like this way Picasso. get(). load("http://i.imgur.com/DvpvklR.png").into(imageView); and in their website you can get every details. In your case you can parse every image URL and use RecyclerView to show them along with Picasso.

Which is better Picasso or glide Android?

Glide is faster and the results of Picasso and Coil are similar. But what about when we are loading from the cache. As you can see in the images below we have the best times for Glide in most of the cases.

What is Picasso library in Android?

Android App Development for Beginners Picasso is image processing library and developed by Square Inc.


2 Answers

Of course you can. Its actually pretty straight forward:

File f = new File("path-to-file/file.png"); 

or

File f = new File(uri);  Picasso.get().load(f).into(imageView); 

also

Picasso.get().load(uri).into(imageView); 

works

like image 197
Patrick Favre Avatar answered Oct 06 '22 03:10

Patrick Favre


Yes you can.

Try:

Picasso.with(context).load(new File(YOUR_FILE_PATH)).into(imageView); 

EDIT

You can also call .load(YOUR_URI) instead as well.

like image 41
egfconnor Avatar answered Oct 06 '22 02:10

egfconnor