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
March 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.03.15 17:56 "Need to write CCITT T.6 encoded TIFF file data directly to memory buffer", by Roger Watkins
2005.03.15 18:09 "Re: Need to write CCITT T.6 encoded TIFF file data directly tomemory buffer", by Joris Van Damme
2005.03.16 18:08 "Re: Need to write CCITT T.6 encoded TIFF file data directly tomemory buffer", by Roger Watkins
2005.03.16 19:38 "Re: Need to write CCITT T.6 encoded TIFF file data directlytomemory buffer", by Joris Van Damme
2005.03.16 22:04 "Re: Need to write CCITT T.6 encoded TIFF file data directlytomemory buffer", by Roger Watkins
2005.03.16 22:24 "Re: Need to write CCITT T.6 encoded TIFF file datadirectlytomemory buffer", by Joris Van Damme
2005.03.17 02:35 "Re: Need to write CCITT T.6 encoded TIFF file datadirectlytomemory buffer", by Roger Watkins
2005.03.17 03:10 "Re: Need to write CCITT T.6 encoded TIFF filedatadirectlytomemory buffer", by Joris Van Damme
2005.03.17 23:57 "Re: Need to write CCITT T.6 encoded TIFF file datadirectlytomemory buffer", by Roger Watkins

2005.03.17 03:10 "Re: Need to write CCITT T.6 encoded TIFF filedatadirectlytomemory buffer", by Joris Van Damme

Roger,

> After using TIFFClientOpen() and setting up special handler functions, will
> TIFFClose() work appropriately for the tiff so opened?

TIFFClose will call the 'platform/medium dependent' close procedure, a pointer
to which is also a parameter of the TIFFClientOpen functions. This
platform/medium dependent close procedure of your own implementation can take
care of specific closing and cleaning up. This explains the following
implementations of such platform/medium dependent close procedures in
LibTiffDelphi.pas:

for file, just use the windows CloseHandle function on the file handle, as this
is the proper equivalent of the TIFFOpen action implementation
function TIFFFileCloseProc(Fd: Cardinal): Integer; cdecl;
begin
  if CloseHandle(Fd)=True then
    Result:=0
  else
    Result:=-1;
end;

for stream, there is no opening as such, and there is also no closing
equivalent:
function TIFFStreamCloseProc(Fd: Cardinal): Integer; cdecl;
begin
  Result:=0;
end;

The most common mistake when using TStream, is forgetting to reset the 'file
pointer' back to 0. This is needed when having written, and next eg reading
back. It may be the cause of your question. You can reset the 'file pointer'
calling its Seek method with parameters (0,soFromBeginning).


Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html