我需要找到一种方法来计算图像的长度和宽度(这是一个.jpg)我有文件的长度但它没有用,因为我想创建一个数组来存储关于每个像素的信息我正在使用的图像文件。
public void getImageData(){
    File f= new File("myPicture.jpg");
    this.length = (int) f.length();
        System.out.println("length of file = " + length);
        BufferedImage image = null;
        try {
            image = ImageIO.read(f);
            } 
        catch (IOException e) {
            e.printStackTrace();
            }
非常感谢帮助!