0

I'm using Picasso to load images from URLs into ImageViews. The problem is that all images are being displayed in landscape. The thing is that if the image is in landscape it needs to be displayed in landscape and if the image is in portrait it need to be displayed in portrait. If I use .rotate(90), the images that are correctly in the landscape mode will be rotated too.

ImageView image = new ImageView(getActivity());
        Picasso.with(getActivity())
                .load(details.getUrl())
                .into(image);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        params.gravity = Gravity.CENTER;
        image.setLayoutParams(params);
        ll.addView(image);
Jolan
  • 681
  • 12
  • 39
  • Are your images rotated to landscape? I don't understand why would this happen. Can you link us your images? – JonZarate Mar 20 '17 at 13:22
  • I edited my post mate, check it out – Jolan Mar 20 '17 at 13:33
  • It seems to be that Picasso is not reading the EXIF of the files. Maybe you should correct that in your images. – JonZarate Mar 20 '17 at 13:36
  • How do I do that? – Jolan Mar 20 '17 at 14:52
  • Search what EXIF is and the come and ask a proper question. *How I do that?* doesn't show any effort nor research from your side. – JonZarate Mar 20 '17 at 14:53
  • I've already read about EXIF, supposedly there is an error with it's rotation handling in Picasso. I'm supposed to be rotating the image in code by myself but I've no idea how to do the rotation when the image is in portrait only. I did some research before posting the original question. – Jolan Mar 20 '17 at 15:01
  • What I am saying is that **your images** could have the wrong EXIF. Check it, solve it and if you have any issues while implementing it, come ask us. – JonZarate Mar 20 '17 at 15:03
  • http://stackoverflow.com/questions/3647993/android-bitmaps-loaded-from-gallery-are-rotated-in-imageview have u review this one? Note that there are TWO, separate issues , only one of which concerns the EXIF interface. You should account for both issues. – Robert Rowntree Mar 21 '17 at 18:11

0 Answers0