AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2005

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



2005.11.17 22:43 "[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.