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
September 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!



Thread

2005.09.08 17:24 "Re: [Gdal-dev] Problem of creation with Gtiff driver on Solaris", by Frank Warmerdam
2005.09.12 13:00 "Re: [Gdal-dev] Problem of creation with Gtiff driver on Solaris", by Frédéric Trastour
2005.09.12 13:47 "Re: [Gdal-dev] Problem of creation with Gtiff driver on Solaris", by Frank Warmerdam
2005.09.12 15:46 "Re: [Gdal-dev] Problem of creation with Gtiff driver on Solaris", by Edward Lam

2005.09.12 13:47 "Re: [Gdal-dev] Problem of creation with Gtiff driver on Solaris", by Frank Warmerdam

On 9/12/05, Frédéric Trastour wrote:
> 
> > Try the patch (adding TIFFSeekFile(tif,0,SEEK_SET) before the
> > WriteOK call and see if that helps.
> 
> Thanks a lot, this solves the problem.
> 
> It's really strange anyway and It's not very reassuring to see that simple file
> access may be broken on Solaris. There are probably tons of similar code
> in other drivers...

Frédéric,

Ed Grissom informed me that:

> Not sure if this has *any* bearing at all, but the doc for "fopen" for some
> STD_C_LIBs says that if you open a file for modify ("+"), then you must
> fseek (or fflush?)  between any freads and fwrites.  I believe that for some
> systems, this is not strictly necessary, but for others it is.

Thus, it may be that the Solaris stdio isn't broken, it just chooses to make
things difficult while staying within the specification.  I don't know how many
other parts of the library may be affected but this is the one that has bitten
us in the past.  

I think the seek was removed in the past because it made it difficult for
someone to implement stream oriented access to TIFF files though I am not
very sure about that aspect.  In any event, I think I had better re-introduce
the seek in the core code till we work out more details. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent