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
January 2011

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!



Thread

2011.01.10 16:47 "[libtiff v3.9.4] TIFFClientOpen() & 'w' mode", by <imol00@gmail.com>
2011.01.10 17:53 "Re: [libtiff v3.9.4] TIFFClientOpen() & 'w' mode", by Olivier Paquet
2011.01.11 03:17 "Re: [libtiff v3.9.4] TIFFClientOpen() & 'w' mode", by <imol00@gmail.com>

2011.01.10 16:47 "[libtiff v3.9.4] TIFFClientOpen() & 'w' mode", by <imol00@gmail.com>

[Sending again since it didn't seem to make it to the list.]

I've been trying to track down a problem with writing TIFF files to a
networked drive using Qt and I ran across an oddity in
TIFFClientOpen().  Don't think it has anything to do with my problem,
but I'm curious.

If called with mode == 'w':

...
       m = _TIFFgetMode(mode, module);
// m will be O_RDWR|O_CREAT|O_TRUNC
...
       tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
// tif->tif_mode will be O_RDWR
...
       /*
        * Read in TIFF header.
        */
       if (tif->tif_mode & O_TRUNC ||
           !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {
...

If I'm reading the code correctly, tif->tif_mode & O_TRUNC in the if
statement will always be false.  So shouldn't that be m & O_TRUNC?

Thanks for any insight.

-- Andy

[After writing this I found a post from 2005 about this:
http://www.asmail.be/msg0055533963.html  but I don't think his
solution can be correct...]