Java detecting image heght and width

i want to detect height and widhth of image using java code

Hi there,


Thanks for your inquiry. Please find below code snippet for getting image height and width. Hopefully it will serve the purpose.

com.aspose.imaging.Image image = com.aspose.imaging.Image.load(“E:/Data/test.bmp”);

int imageHeight=image.getHeight();
int imageWidth=image.getWidth();
System.out.println(“Height:”+imageHeight);
System.out.println(“Width:”+imageWidth);

Please feel free to contact us for any further assistance.

Best Regards,