Hello,
I am trying to use the JPEGDecodeParams object to decode an abbreviated jpeg
stream. I keep on getting an error stating that I do not have a
quantization table set when I try decoding some of the jpeg streams that I
am working with. I have tried using the code below but keep on crashing the
java interpreter. The java api docs lead me to believe that it is possible
because of the setJPEGDecodeParams description reproduced below:
public void setJPEGDecodeParam(JPEGDecodeParam jdp)
Sets the JPEGDecodeParam object used to determine the features of the
decompression performed on
the JPEG encoded data. This is ussually only needed for decoding
abbreviated JPEG data streams.
Parameters:
jdp - JPEGDecodeParam object
Has anyone had any luck doing this on the Windows NT platform ?? The code I
tried doing this with appears below:
// input is of type SeekableStream
// Try getting an JPEGDecodeParam object
JPEGDecodeParam jdp =
computeJPEGDecodeParam(dataType,
numBands,
imageRep);
JPEGImageDecoder decoder =
JPEGCodec.createJPEGDecoder(input);
System.out.println("decoder created" );
decoder.setJPEGDecodeParam(jdp);
System.out.println("decode param set" );
// .....
private JPEGDecodeParam computeJPEGDecodeParam(int dataType,
int numbands,
String irep){
Raster theRaster =
Raster.createInterleavedRaster(dataType,1,1,numbands,
new Point(0,0));
JPEGEncodeParam jep =
JPEGCodec.getDefaultJPEGEncodeParam(theRaster,
getColorID(irep));
// Set some of the JPEGEncode parameters
jep.setQTable(0,JPEGQTable.StdLuminance);
if(nb > 1){
jep.setQTable(1,JPEGQTable.StdChrominance);
// jep.setQTable(2,JPEGQTable.StdChrominance);
}
return ((JPEGDecodeParam)jep);
}
Any help would be appreciated.
Peter
Peter Stamboulis
181/2A-15
(301)240-4171
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".