8 Replies Latest reply: Mar 9, 2011 9:17 AM by 804091 RSS

    Get width and height of tiff image problem

    MSC
      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;
          }