2005.11.17 22:43 "[Tiff] [libtiff v3.7.3] TIFFClientOpen - possible bug when 'mode' = 'w' ?", by Nghia Tran

Hi

I'm writing a DLL that exposes a 'tiff2pdf' conversion routine so it can be called from VB6. I base my code on the tool 'tiff2pdf' which comes part of libtiff. So create my own structure, implement the 4 function pointers, and use TIFFClientOpen() to pass in the handles. No problem with the input file.
 For the output file, when I traced the call to TIFFClientOpen:

   output = TIFFClientOpen("dummyOutput", "w", (thandle_t) &pdfFile,
                         MemFileReadProc, MemFileWriteProc,
                         MemFileSeekProc, MemFileCloseProc,

MemFileSizeProc, NULL,
NULL);

in the file tif_open.c, at line 169:
  tif->tif_mode = m &~ (O_CREAT|O_TRUNC);

This statement causes the code that setups the TIFF header starting at line 307 to be skipped over. So what is the purpose of line 169?

To make my code work, I commented out line 169 in tif_open.c, but I'm unsure if there's any other problem elsewhere since this is my first attempt at using libtiff.
My environment is VS6 SP6, WinXP SP1.

Can someone help?
Thanks in advance.
 Nghia Tran.

---------------------------------
 ____________________________________________________
---------------------------------
Do you Yahoo!?

Never miss an Instant Message - Yahoo! Messenger for SMS