>>>>> "FI" == Felicia Ionascu <[EMAIL PROTECTED]> writes:
FI> Hello Batik Fellows, I must tell you that I'm very fond of Batik
FI> now that it works smoothly in our project. I'll do some
FI> advertising for it here in our company :-)
I am glad to hear it. :)
FI> I still want to optimize things. The multipage TIFF that I
FI> generate is yet not compressed. With Packbits compression, I
FI> always have a corrupt result. The message that I get when
FI> analysing the file is:
K:\local\bin\nt>tiffvalidator c:\DetailedWithCompanyLogo.tif
TIFF Directory at offset 0x8
Image Width: 1076 Image Length: 1523
Resolution: 150, 150
Bits/Sample: 8
Compression Scheme: CCITT RLE
Photometric Interpretation: RGB color
Samples/Pixel: 3
Rows/Strip: 8
Planar Configuration: single image plane
TIFFFillStrip: c:\DetailedWithCompanyLogo.tif: Read error on strip 0;
got 0 bytes, expected 25824.
Status=[CORRUPTED]
Hmm, can you send (just to me please) or put up on a web site an
example file?
FI> The code that I use is below:
Hmm, well I've personally never used the Tiff encoder for
Multi-Page or compressed TIFF's (the encoder was generously donated by
Sun from JAI).
Some other questions, is the output stream some form of seekable
stream (like File for instance?). Is the code running as an
application or an applet?
Do you get any really helpful messages like:
'TIFFImageEncoder8'?
FI> //NOTES // bufferedImagesList is a Vector containing FormatRed
FI> objects of type TYPE_3BYTE_BGR and the sample model
FI> PixelInterleavedSampleModel //renderedImage is a FormatRed object
FI> of the same type and sample models as the bufferedImagesList
FI> objects
FI> TIFFEncodeParam encodeParam = new TIFFEncodeParam();
FI> //this is for the multipage output
FI> encodeParam.setExtraImages(bufferedImagesList.iterator());
FI> //set the image resolution to 150 TIFFField[] extras = new
FI> TIFFField[2]; extras[0] = new TIFFField(282,
FI> TIFFField.TIFF_RATIONAL, 1, (Object)new long[][] {{(long)150,
FI> (long)1},{(long)0 ,(long)0}}); extras[1] = new TIFFField(283,
FI> TIFFField.TIFF_RATIONAL, 1, (Object)new long[][] {{(long)150,
FI> (long)1},{(long)0 ,(long)0}}); encodeParam.setExtraFields(extras);
FI> //this should be for the compression
FI> encodeParam.setCompression(TIFFEncodeParam.COMPRESSION_PACKBITS);
FI> //and now... encode it! OutputStream outputStream = new
FI> FileOutputStream (outputFilename); TIFFImageEncoder encoder = new
FI> TIFFImageEncoder (outputStream, encodeParam);
FI> encoder.encode(renderedImage); outputStream.close(); outputStream
FI> = null; [...]
FI> I wonder if it is supposed to work. Did you encounter a similar
FI> situation?
FI> Thanks a lot in advance, Felicia
FI> -- ------------------------------------------------------------
FI> Felicia IONASCU Oc� Print Logic Technologies mailto:[EMAIL PROTECTED]
FI> 1, rue Jean Lemoine phone : +33 (0)1 48 98 81 99 94015 Cr�teil
FI> cedex, France fax: +33 (0)1 48 98 54 50 http://www.oce.com/
FI> ------------------------------------------------------------
FI> ---------------------------------------------------------------------
FI> To unsubscribe, e-mail: [EMAIL PROTECTED] For
FI> additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]