This discussion is archived
8 Replies Latest reply: Mar 9, 2011 7:17 AM by 804091 RSS

Get width and height of tiff image problem

798853 Newbie
Currently Being Moderated
I have method like below , and work fine with all image type file , except for .tif , the out put for width and height will return -1 . I couldn't find the way for it . could you please advise me the way ?
    static int[] imageFileProperlies(File file) throws IOException {
        int[] i = new int[2];
        ImageIcon image = new ImageIcon(file.getAbsolutePath());
        i[0] = image.getIconWidth();
        i[1] = image.getIconHeight();
        return i;
    }

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points