reactor
reactor

Reputation: 1931

Picasso with recyclerview auto rotates some images

I'm having issues with Picasso displaying some pictures in the wrong orientation and others in the right one. I have this one rotated: https://i.sstatic.net/3zhTi.jpg . I've seen threads like this one: Picasso displays in wrong orientation and this one: Why image auto rotate when set to Imageview with Picasso where it's recommended to either use Compressor from https://github.com/zetbaitsu/Compressor or to manually rotate it.

I was hoping for one that just undoes the weird rotation for a standard recycler view carousel experience pulling from uris. I'd also be open to techniques to keep it uniform such as to crop the images in a recyclerview to deal with the potential issue of the proportions causing this: Android ImageView Displaying Rotated Images Although Source Is Not Rotated.

Upvotes: 0

Views: 122

Answers (1)

Sandeep Pareek
Sandeep Pareek

Reputation: 1789

I faced a problem like this, and I solved it with the Glide library.

dependencies {

      implementation 'com.github.bumptech.glide:glide:4.11.0'
      annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
 }

and just

 GlideApp.with(context)
         .load("http://via.url.com/300.png")
         .placeholder(R.drawable.placeholder)
         .error(R.drawable.imagenotfound)
         .into(ivImg);

Upvotes: 1

Related Questions