
Thread
2013.09.20 15:36 "Re: [Tiff] Patch: tiff2pdf inverted page issue for G4 bilevel", by Lee Howard
Thanks. I've committed your suggested patch to CVS.
Lee.
On 07/18/2013 11:36 AM, David Ryskalczyk wrote: > Here's a patch to correct an issue with creating G4-compressed PDFs.
>
> The issue is caused by == being used to compare bitfields when only > one bit is intended to be compared. Some of the tiffs I have had both
> T2P_CS_ICCBASED and T2P_CS_BILEVEL set; therefore, the current code > will fail, producing certain pages that are inverted.
>
> The patch follows, and is also attached.
>
> --David
>
> Index: tools/tiff2pdf.c
> ===================================================================
> RCS file: /cvs/maptools/cvsroot/libtiff/tools/tiff2pdf.c,v
> retrieving revision 1.71
> diff -r1.71 tiff2pdf.c
> 4218,4219c4218,4219
> < if(t2p->pdf_colorspace == T2P_CS_BILEVEL
> < || t2p->pdf_colorspace == T2P_CS_GRAY
> ---
>> if((t2p->pdf_colorspace & T2P_CS_BILEVEL)
>> || (t2p->pdf_colorspace & T2P_CS_GRAY)
> 4674c4674
> < &&! (t2p->pdf_colorspace == T2P_CS_BILEVEL
> ---
>> &&! ((t2p->pdf_colorspace & T2P_CS_BILEVEL)