W
weiss.matt
Hey All,
I have a question about Java advanced imaging. I hope this is the
correct group.
Anyhoo, I'm using Java advanced imaging (JAI) version 1.1.2 and I'm
trying to embed an ICC profile into a tiff. I do have it working, but
it is taking an incredibly long amount of time. Yes, the tiff that
I'm trying to embed a profile into is about 40 MB, nevertheless, I
don't know why this operation it taking so long. I have a similar
function where I set the DPI of a TIFF image and it works almost
instantaneously.
Here's my code:
public static PlanarImage embedProfile(PlanarImage planarImage,
ICC_Profile iccProfile)
{
ByteArrayOutputStream outStream;
TIFFEncodeParam param = new TIFFEncodeParam();
TIFFField [] iccprofilefield = new TIFFField[1];
byte[] biccProfileArray = iccProfile.getData();
iccprofilefield[0] = new TIFFField(
BaselineTIFFTagSet.TAG_ICC_PROFILE,
TIFFField.TIFF_UNDEFINED, biccProfileArray.length,
biccProfileArray);
param.setExtraFields(iccprofilefield);
outStream = new ByteArrayOutputStream();
TIFFImageEncoder enc = new TIFFImageEncoder(outStream,
param);
enc.encode(planarImage);
outStream.close();
return new
ImageProcessing().byteArrayToPlanarImage(outStream.toByteArray());
}
If I step through the code in the debugger almost all of the time is
spent at the encode() function call. I'd get the source, and debug
through it, but for some strange reason I can't find 1.1.2, only 1.1.1.
Is it not available?
Thanks in advance,
Matt
I have a question about Java advanced imaging. I hope this is the
correct group.
Anyhoo, I'm using Java advanced imaging (JAI) version 1.1.2 and I'm
trying to embed an ICC profile into a tiff. I do have it working, but
it is taking an incredibly long amount of time. Yes, the tiff that
I'm trying to embed a profile into is about 40 MB, nevertheless, I
don't know why this operation it taking so long. I have a similar
function where I set the DPI of a TIFF image and it works almost
instantaneously.
Here's my code:
public static PlanarImage embedProfile(PlanarImage planarImage,
ICC_Profile iccProfile)
{
ByteArrayOutputStream outStream;
TIFFEncodeParam param = new TIFFEncodeParam();
TIFFField [] iccprofilefield = new TIFFField[1];
byte[] biccProfileArray = iccProfile.getData();
iccprofilefield[0] = new TIFFField(
BaselineTIFFTagSet.TAG_ICC_PROFILE,
TIFFField.TIFF_UNDEFINED, biccProfileArray.length,
biccProfileArray);
param.setExtraFields(iccprofilefield);
outStream = new ByteArrayOutputStream();
TIFFImageEncoder enc = new TIFFImageEncoder(outStream,
param);
enc.encode(planarImage);
outStream.close();
return new
ImageProcessing().byteArrayToPlanarImage(outStream.toByteArray());
}
If I step through the code in the debugger almost all of the time is
spent at the encode() function call. I'd get the source, and debug
through it, but for some strange reason I can't find 1.1.2, only 1.1.1.
Is it not available?
Thanks in advance,
Matt