2007.10.05 14:39 "[Tiff] Color issues in Tiff2pdf", by Richard Nolde

2007.10.05 14:39 "[Tiff] Color issues in Tiff2pdf", by Richard Nolde

Regarding color issues with tiff2pdf, the following may or may not be related but it is a bug that could be patched. The line numbers are appropriate for the tiff-3.8.2 version of tiff2pdf.c. In personal correspondence with the author of the software, Ross Finlayson, he agreed that the assignment for the alpha channel info is incorrect.

extract from note to Ross:

"I think there is a typo at line 1486 in the current distribution where it appears that the alpha channel overwrites the blue channel in RGBA images.

Should the final line have (i * 4) + 3 instead of (i * 4 ) + 2?

       for(i=0;i<t2p->pdf_palettesize;i++){
           t2p->pdf_palette[(i*4)] = (unsigned char) (r[i]>>8);
           t2p->pdf_palette[(i*4)+1]= (unsigned char) (g[i]>>8);
           t2p->pdf_palette[(i*4)+2]= (unsigned char) (b[i]>>8);
           t2p->pdf_palette[(i*4)+2]= (unsigned char) (a[i]>>8);
       }
"

Richard Nolde