2009.12.28 19:46 "Re: [Tiff] bug in tiff2pdf, when handling Lab images", by Manlio Perillo

2009.12.28 16:59 "Re: [Tiff] bug in tiff2pdf, when handling Lab images", by Lee Howard

I'm reporting the bug here, since on the libtiff web site (http://www.libtiff.org/bugs.html), the link to the bug traker is broken:

That's the "old" domain before it was hijacked. Now look for:

http://remotesensing.org/libtiff/

http://bugzilla.remotesensing.org/buglist.cgi?product=libtiff

http://remotesensing.org/libtiff/bugs.html

By the way, the link to this mailing list is broken, too.

Not surprising.

The problem is with tiff2pdf writing two times the WhitePoint entry in the Lab dictionary:

/ColorSpace [/Lab <<

/WhitePoint

[0.9643 1.0000 0.8251]

[0.9643 1.0000 0.8251]

> /Range [-127 127 -127 127]
>
>>> ]

If you look at the code this appears to be intentional:

        if(t2p->pdf_colorspace & T2P_CS_LAB){
                        written += t2pWriteFile(output, (tdata_t) "[/Lab
<< \n", 10);
                        written += t2pWriteFile(output, (tdata_t)
"/WhitePoint ", 12);

                        X_W = t2p->tiff_whitechromaticities[0];
                        Y_W = t2p->tiff_whitechromaticities[1];
                        Z_W = 1.0F - (X_W + Y_W);
                        X_W /= Y_W;
                        Z_W /= Y_W;
                        Y_W = 1.0F;
                        buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", 

X_W, Y_W, Z_W);
                        written += t2pWriteFile(output, (tdata_t)
buffer, buflen);
                        X_W = 0.3457F; /* 0.3127F; */ /* D50, commented
D65 */
                        Y_W = 0.3585F; /* 0.3290F; */
                        Z_W = 1.0F - (X_W + Y_W);
                        X_W /= Y_W;
                        Z_W /= Y_W;
                        Y_W = 1.0F;
                        buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n",
X_W, Y_W, Z_W);
                        written += t2pWriteFile(output, (tdata_t)
buffer, buflen);
                        written += t2pWriteFile(output, (tdata_t)
"/Range ", 7);
                        buflen=sprintf(buffer, "[%d %d %d %d] \n",
                                t2p->pdf_labrange[0],
                                t2p->pdf_labrange[1],
                                t2p->pdf_labrange[2],
                                t2p->pdf_labrange[3]);
                        written += t2pWriteFile(output, (tdata_t)
buffer, buflen);
                        written += t2pWriteFile(output, (tdata_t) ">>]
\n", 5);

        }

Are you sure that this is the problem? Are you sure that it's not something else?

Thanks,

Lee.