0

I am trying to populate an image in an ImageView using Picasso, but the image is populated upside down or rotated 90 degrees. Below is the code for populating the image. This is happening with one few images.

Picasso.with(context)
                    .load(NetworkConstants.IMAGE_PREFIX + flag.get(position).getFilePath())
                    .placeholder(R.drawable.img_placeholder)
                    .error(R.drawable.img_placeholder)
                    .resize(400, 400)
                    .centerInside()
                    .into(busines_img);

The outcome of this code is:

Only this picture is upside down.

Url For the Image

This same picture comes properly in IOS devices. Thank in Advance for you help.

Pritesh
  • 139
  • 2
  • 12

2 Answers2

1

Could be a bug because the image orientation is wrong in your photo EXIF. This snippet might help you: https://github.com/square/picasso/blob/c1d60eea6cf7116fa547e573d992794a7ba82414/picasso/src/main/java/com/squareup/picasso/FileBitmapHunter.java

M'aiq the Coder
  • 762
  • 6
  • 18
  • Thank you it helped me, but can you help as how to get exif information for a remote file. – Pritesh Jul 16 '18 at 14:38
  • Unfortunately I do not know anything more about EXIFs and how to use them inside Android Studio. But for checking the actual information you can use this site https://www.get-metadata.com/ and upload your photos there and the site will tell you all the secrets of that photo. – M'aiq the Coder Jul 17 '18 at 05:41
0

Try adding .rotate(180) in your code.

M'aiq the Coder
  • 762
  • 6
  • 18