public static void main(String[] args) throws IOException {
File file = new File("F:\\111.jpg");
FileInputStream in = new FileInputStream(file);
BufferedImage bi = ImageIO.read(in);// 通过ImageIO读取输入流来获取一个BufferedImage对象
int height = bi.getHeight();//获取高度
int width = bi.getWidth();//获取宽度
}