I'll add that hack. Just another one to take care of broken files...

Best Regards,
Paulo Soares

----- Original Message ----- 
From: "Trevor Linton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 11, 2003 20:01
Subject: [iText-questions] TIFF problem


> Hi, 
>  
> I've been developing with iText and i've noticed some problems with
> iText, a specific TIF file (found at
> http://wendy.verite.com/~trevor/logo.tif
> <http://wendy.verite.com/~trevor/logo.tif> ) was producing the following
> error when I tried to use: document.add(Image.getInstance("logo.tif"));
>  
> Exception in thread "main" ExceptionConverter: ExceptionConverter:
> java.lang.ArrayIndexOutOfBoundsException: 7539
>         at
> com.lowagie.text.pdf.codec.TIFFLZWDecoder.writeString(TIFFLZWDecoder.jav
> a:176)
>         at
> com.lowagie.text.pdf.codec.TIFFLZWDecoder.decode(TIFFLZWDecoder.java:117
> )
>         at
> com.lowagie.text.pdf.codec.TiffImage.getTiffImageColor(Unknown Source)
>         at com.lowagie.text.pdf.codec.TiffImage.getTiffImage(Unknown
> Source)
>         at com.lowagie.text.pdf.codec.TiffImage.getTiffImage(Unknown
> Source)
>         at com.lowagie.text.Image.getInstance(Unknown Source)
>         at com.lowagie.text.Image.getInstance(Unknown Source)
>         at Test.main(Test.java:18)
>  
> I was able to fix the error in what I think was a hack rather than a fix
> (but the image rendered, so all is well that ends well right?) I changed
> line com/lowagie/text/pdf/codec/TIFFLZWDecoder (176) from:
>  
> uncompData[dstIndex++] = string[i];
>  
> to:
>  
> if(uncompData.length > dstIndex)
>     uncompData[dstIndex++] = string[i];
>  
>  
> - Trevor
> 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to