2010.12.01 17:40 "Re: [Tiff] Win32 ReadFile() / WriteFile() heads-up", by John Emmas
On 30 Nov 2010, at 19:26, Toby Thain wrote:
> Can't the existing tif_unix entry points be used, if the application
> wants to use POSIX file handles?
This does in fact work tantalizingly well, except for a problem (in libgdk_pixbuf) which I need some advice about, before I report it to them Here's the sequence of events now that I'm using tif_unix.c instead of tif_win32.c:-
- libgdk_pixbuf begins by opening the TIFF file using _wfopen()
- To load the image, it seems to call TIFFFdOpen()
- Which in turn, calls TIFFClientOpen()
- Note that neither step 2 nor step 3 actually opens any file!
- Now that I've re-jigged the modules, read() is now used for reading the TIFF header and data, instead of ReadFile()
- After loading the image, libgdk_pixbuf now calls TIFFClose() on the value returned by TIFFFdOpen(). THIS CLOSES THE FILE!!!
- libgdk_pixbuf then goes on to call close() (which asserts, because the file is already closed!)
Since neither TIFFFdOpen() nor TIFFClientOpen() actually opened any file, I'm guessing that libgdk_pixbuf should only have called TIFFCleanup(), rather than TIFFClose(). Does that seem reasonable?