2

I am trying to encode (write) jpeg 2000 in Java. I am reading a '.bmp' image and try to write '.jp2' image. I am using:

javax.imageio.ImageIO.write(img1, "jpeg 2000", file1);

I do not receive any error, but the size of the produced image is zero. Can anybody help me please?

Thanks a lot in advance.

Vebjorn Ljosa
  • 17,438
  • 13
  • 70
  • 88
Shadi
  • 649
  • 3
  • 15
  • 30
  • 1
    Please provide more information. What is img1? Is it valid? What is file1? Is it valid? ... – InsertNickHere Sep 21 '10 at 18:34
  • img1 is a BufferedImage, file1 is declared as: new File("E/a.jp2"); they are valid, because if I try to write the image as a 'bmp', 'jpg' or 'png' file, everything is fine. – Shadi Sep 21 '10 at 18:37
  • @Shadi ok it should work then, sorry that I cant help you. – InsertNickHere Sep 21 '10 at 18:58
  • check the links http://forums.sun.com/thread.jspa?threadID=5318325 and http://stackoverflow.com/questions/2662916/read-jpeg2000-files-in-java. These might help. – Emil Sep 22 '10 at 09:42
  • Thanks Emil, I had checked them before, they could not have helped me. BTW, than you. – Shadi Sep 23 '10 at 15:30

1 Answers1

1

The only problem was that when I was installing JAI_ImageIO, I should have selected "custome installation" and checked everything to be installed. Thanks everyone.

Shadi
  • 649
  • 3
  • 15
  • 30