Domanda

I'm trying to read some jpeg-lossless images and show in my project. by the way, these images are DICOM file. After recognizing type of image, I wrote this code:

if (tsuid.equals(TransferSyntax.JPEGLossless)) 
      readerWanted = "jpeg-lossless";
reader = (ImageReader) (ImageIO.getImageReadersByFormatName(readerWanted).next());

but when I ran it, I got this error:

No reader for jpeg-lossless available for Transfer Syntax 1.2.840.10008.1.2.4.70 Caused by: java.util.NoSuchElementException

I've searched in the Internet and I figure out that I have to install Image I/O Tools. then I install that in OS and my project worked very well.

But my problem: I wanna add "jai-image-io" tools in my libraries such as another jar libraries that added there,too. because my application should install on lots of client systems that I can't install extra tools. I don't know how I can do it?

Thank you in advance.

È stato utile?

Soluzione

Sounds like your problem is deployment.

  • You need to have the Java classes in the classpath
  • You need to have the binaries in the java.library.path

Depending how you are deploying, you could use the web start versions of JAI (http://download.java.net/media/jai-imageio/webstart/release/) or just build your own package and put the necessary jars and libraries in a known location (then use -Djava.library.path=<some location> to set it).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top