Please post your fix. Apparentely nobody can produce correct G4 files
and the burden is on the viewers to fix the broken files. iText does
some effort to fix it but only goes so far.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Tessler, Micah (M.B.)
> Sent: Monday, May 05, 2008 5:20 PM
> To: [email protected]
> Subject: [iText-questions] Invalid TIFF -- Invalid code
> encountered whiledecoding 2D group 4 compressed data.
>
> I am working with a set of tiffs, several of which are invalid.
> When reading into iText, I get the following error message:
> Invalid TIFF -- Invalid code encountered while decoding 2D
> group 4 compressed data.
> iText version = 2.02
>
> My question is regarding the cause of the issue and some
> possible approaches to fixing it.
>
> Windows Picture and Fax Viewer, and Microsoft Paint can both
> read and render the invalid tiffs, but iText always errors out.
>
> In the iText code, I was able to fix the error by modifying
> the iText method:
> com.lowagie.text.pdf.codec.TIFFFaxDecoder.decodeT6()
>
> Where there is an if/else block within a loop that checks the
> code to decide if something is horizontal (code=1), vertical
> (codes = 2-8), pass (code=0), or extension (code = 11), I am
> getting a code of 10.
>
> iText libraries throw the exception "Invalid TIFF -- Invalid
> code encountered while decoding 2D group 4 compressed data."
> in that case. I hacked the code to instead do the following
> in the unknown code block to treat the invalid code as a
> line-break. Which renders the Tiff in iText the same way
> that the as the Microsoft viewers do.
>
> bitOffset = w;
> updatePointer(7 - bits);
>
> Questions:
> 1) Is the 10-code linebreak a valid extension to the T-6 spec?
> 2) How would one go about "fixing" the tiff data to be iText
> friendly?
> Removing the bad codes and inserting enough
> horizontal white pixels to end the line?
> 3) Is there a later release of iText that addresses the
> invalid tiff question?
>
> Thanks,
> -Micah
>
>
> Micah Tessler
> Consulting Architect
> Ford Credit Enterprise Architecture
> (313) 322-4267
> [EMAIL PROTECTED]
>
>
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 the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar