Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JAI + JPEG2000

6 views
Skip to first unread message

Sebastian Ryszard Kruk

unread,
Dec 5, 2003, 3:37:41 AM12/5/03
to
Hi,

did any one manage to read/write JPEG2000 images with JAI Tools? I got
an error like this while writing

Exception in thread "main" java.lang.NoClassDefFoundError:
com/sun/medialib/codec/jp2k/Encoder
at
com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageWriterCodecLib.write(J2KImageWriterCodecLib.java:143)
at javax.imageio.ImageWriter.write(ImageWriter.java:591)
at javax.imageio.ImageIO.write(ImageIO.java:1434)
at javax.imageio.ImageIO.write(ImageIO.java:1472)
at Convert.main(Convert.java:31)

it seams to me that jp2k library is not in the classes that JAI is
trying to find - but rather in /jj2000 package.

Do you do something wrong? How to solve it?

I attach my code.

Thanks in advance

skruk

// ==========================================

public static void main( String[] argv ) {
try {
String inputFilename = argv[0];
BufferedImage image = ImageIO.read( new File( inputFilename ) );
//...
String formatName = argv[1];// desired format
String outputFilename = inputFilename.substring( 0,
inputFilename.lastIndexOf( "." ) + 1 ) + formatName;

File outputFile = new File( outputFilename );
boolean writerExists = ImageIO.write( image, formatName, outputFile );

System.out.println( "STATUS [" + inputFilename + "] -> [" +
outputFilename + "]: " + writerExists );

}
catch( Exception ex ) {
ex.printStackTrace();
}
}

ak

unread,
Dec 5, 2003, 4:16:49 AM12/5/03
to
all questions about JAI you should ask here:
http://archives.java.sun.com/cgi-bin/wa?A0=JAI-INTEREST


--

____________

http://reader.imagero.com the best java image reader.


0 new messages