Reputation: 199
Is there any method that shows if the image is in landscape orientation or not?
I have a file and I create a BufferedImage
, but don't know what's the method for finding the orientation.
Upvotes: 1
Views: 4171
Reputation: 72
try this ....
if (image.getIconWidth() > image.getIconHeight())
{ result = 0;
} else {
result = 1;
}
Upvotes: 0
Reputation: 2874
There are not method but the easiest way:
public boolean isLandscape(BufferedImage image){
return image.getWidth() > image.getHeight();
}
You could put this method to some Utils class.
Upvotes: 2