2

Any idea or suggestion that can be done to detect the images from url is portrait or landscape. I need to display different size if portrait scaletype:fix_center and is landscape scaletype:fixXY.

Bhargav Rao
  • 45,811
  • 27
  • 120
  • 136
micky
  • 225
  • 1
  • 4
  • 16

2 Answers2

0

As long as landscape means wider than taller (and portrait viceversa) it means to read the image into memory and check width and height.

To read image look here: How to display image from URL on Android .

Community
  • 1
  • 1
PeterMmm
  • 23,364
  • 13
  • 69
  • 108
0

You could also use ExifInterface to read EXIF information from the pic (sounds more correct, but PeterMmm's solution may be easier to implement)