use the ExifInterface to get the orientation as the following :
File imageFile = new File(imagePath);
ExifInterface exif = new ExifInterface(imageFile.getAbsolutePath());
int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
boolean isVertical = true ;
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_270:
isVertical = false ;
break;
case ExifInterface.ORIENTATION_ROTATE_90:
isVertical =false ;
break;
}
and so on for the all what you need from the Constants that are in the ExifInterface documentation .
then you can try to do somthing as the following using the Picasso API :
int imageWidth , imageHeight = 0 ;
if(isVertical ) {
imageWidth =1280;
imageHeight=960;
}else if (!isVertical ){
imageWidth =960;
imageHeight=1280;
}
Picasso.with(getActivity())
.load(imageUrl)
.placeholder(R.drawable.placeholder)
.error(R.drawable.error)
.resize(imageWidth , imageHeight)
.centerInside()
.into(imageView);
and please give me some feedback .
Hope taht helps .