Slow loading large images with Picasso

I use Picasso to load JPGs of about 250-500 Kb (1600x ~ 1200) in size from Url in ImageView.

Picasso.with(getApplicationContext()) .load(stringURL) .placeholder(R.drawable.holder).error(R.drawable.holder) .into(image) 

My ImageView:

 <ImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerInParent="true" android:layout_marginTop="0dip" android:adjustViewBounds="true" android:cropToPadding="false" android:scaleType="fitCenter" 

/ ">;

The problem is that the first image load is very slow (about 20 seconds), the processor consumption is high, and therefore the memory allocation. LogCat shows, for example, "Grow heap (frag case) up to 56.789 to allocate 7,601,812 bytes" for a single image.

Something related to image caching? Is there a way to disable caching and directly load the original image into ImageView?

Downloading the same images from the iPhone to a single-user application instantly ...

+5
source share
2 answers

I switched to Will. Downloading the same images takes a little time.

0
source

If you use fit() or resize() , which should fix your problem. I am currently uploading hundreds of jpg files that are very large into one GridLayout and have no problems.

+3
source

Source: https://habr.com/ru/post/1203379/


All Articles