Tiff images compressed with LZW are first decompressed and then
recompressed with flate compression. This takes a lot of memory and
time. Jpeg images are included as-is with any decompression/compression.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Pierre Jourdan
> Sent: Wednesday, May 23, 2007 1:52 PM
> To: [email protected]
> Subject: Re: [iText-questions] performance of tiff
> implementation in itext
>
> I was profiling my application that creates a pdf from multiple files
>
>
> (pdf, jpeg, tiff) using iText2.0.1 and I saw that
> lots of memory and cpu are spent in :
>
> com.lowagie.text.pdf.codec.TIFFLZWDecoder.initializeStringTable
>
> com.lowagie.text.pdf.codec.TIFFLZWDecoder.addStringToTable
> com.lowagie.text.pdf.codec.TiffImage.getTiffImageColor
>
> those allocates many byte Arrays.
>
>
>
> It does what is needed to read the image.
>
>
> Yes, but regarding jpeg or other pdf, tiff decoding requires
> two or three times more memory for same size of source file
> and much more cpu.
> But anyway I have no knowledge in Tiff specifications ; hence
> it mays be just the Tiff format which is a mess and not
> targeted for performance in reading.
>
>
> > Just wondering if there are some ways to improve this
> Tiff codec ?
> Sure, code contributions are always welcome. You may
> also use smaller
>
> images, that will take less memory. This question is in
> line with those
> questions "I create a PDF with 50000 pages and it need
> a lot of memory
> and time, why?".
>
>
> It was not the meaning. Just asking why it takes so much more
> memory and cpu to decode a tiff image, compare to a jpeg
> image (for same size of course)
> and if someone knows already a way to improve that. (like
> first convert the image with another library or use a
> specific iText class that just copy the tiff inside the pdf
> without decoding it).
>
> Notes: my tests are made on tiff images of 2Mo, color 24
> bits, RGB, compression LZW, 1010x1294.
> But yes, I know it's an open-source project and I'm not
> asking the author to work on that right now; don't get upset
> please ;o)
>
> Pierre
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/