您可以使用Java的image类来获取图像属性。以下是示例 -BufferedImage img = ImageIO.read(new File("imageFilePath")); int height = img.getHeight(); int width = img.getWidth();