Picasso image gets rotated by itself

2019-07-25 21:20发布

问题:

I am using the Picasso library as follows, but when I take image and put into ImageView, image gets rotated. I wonder what might cause the issue?

 <ImageView
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:id="@+id/imageViewUser"
    android:background="@color/colorAccent"
    android:contentDescription="@string/description" />

 imageViewUser = (ImageView) findViewById(R.id.imageViewUser);

 Picasso.get().load(url).placeholder(R.drawable.image)
              .error(R.drawable.blank_profile)
              .resize(100, 100)
              .centerCrop()
              .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE)
              .networkPolicy(NetworkPolicy.NO_CACHE, NetworkPolicy.NO_STORE)
              .into(imageViewUser);

回答1:

Sometimes it's happened on some Samsung devices. One way is to manually rotate the needed image. Read more Photo rotated from camera (SAMSUNG device)



回答2:

It has nothing to do with Picasso. It is just mirror effect. It's not your app fault. Try other apps like WhatsApp , Facebook, etc on same device. It could be found only in some manufacturers device.

When we see our image in the mirror (or the front facing camera before clicking a selfie), it is flipped. Flipped in the sense that when we raise OUR LEFT hand, the image raises ITS RIGHT hand. So, how WE see OURSELVES in the mirror is not the way anyone else sees us.