I've come across this issue on occasion as well, and would be
interested in a fix. Next time it occurs I'll retrieve the document and
see what I can learn about it. Unfortunately I will probably not be able
to share it. 

Cory

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Tessler, Micah (M.B.)
> Sent: Tuesday, May 06, 2008 12:00 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Invalid TIFF -- Invalid 
> codeencounteredwhiledecoding 2D group 4 compressed data.
> 
> Thanks for the response, but I remain skeptical that large 
> numbers of scanners are corrupting the T6 compression 
> standard.  And all of the commercial tiff readers (I haven't 
> tried open-source readers other than iText) understand this 
> corruption.
> 
> I submit that a more logical interpretation of the evidence 
> is that there is another standard, other than official T6, 
> that these systems are coded to.  While the TIFF tag says the 
> file is T6 compressed, the compression appears to adhere to 
> an extension of the standard.  I would be curious if anyone 
> has come across these expanded/updated standards.
> 
> Questions:
> 1) Has anyone else come across these expanded/updated standards?
> 
> 2) Has anyone found an open-source tiff-viewer that can 
> handle these corrupted tiffs?  If so, iText may be able to 
> share the expanded decoding algorithm with said viewer.
> 
> Micah Tessler
> Consulting Architect
> Ford Credit Enterprise Architecture
> (313) 322-4267
> [EMAIL PROTECTED]
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Paulo Soares
> Sent: Monday, May 05, 2008 1:02 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Invalid TIFF -- Invalid code 
> encounteredwhiledecoding 2D group 4 compressed data.
> 
> 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
> 



-------------------------------------------------------------------------
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

Reply via email to