* tools/fax2tiff.c (main): Applied patch by Jörg Ahrens to fix

passing client data for Win32 builds using tif_win32.c
(USE_WIN32_FILEIO defined) for file I/O.  Patch was provided via
email on November 20, 2016.
This commit is contained in:
Bob Friesenhahn 2016-11-20 18:04:52 +00:00
parent 884f973652
commit 5ba49e2beb
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2016-11-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* tools/fax2tiff.c (main): Applied patch by Jörg Ahrens to fix
passing client data for Win32 builds using tif_win32.c
(USE_WIN32_FILEIO defined) for file I/O. Patch was provided via
email on November 20, 2016.
2016-11-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* libtiff 4.0.7 released.

View File

@ -1,4 +1,4 @@
/* $Id: fax2tiff.c,v 1.25 2016-10-25 22:22:45 erouault Exp $ */
/* $Id: fax2tiff.c,v 1.26 2016-11-20 18:04:52 bfriesen Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
@ -283,10 +283,11 @@ main(int argc, char* argv[])
}
#if defined(_WIN32) && defined(USE_WIN32_FILEIO)
client_data.fh = _get_osfhandle(fileno(in));
TIFFSetClientdata(faxTIFF, (thandle_t) client_data.fh);
#else
client_data.fd = fileno(in);
TIFFSetClientdata(faxTIFF, (thandle_t) client_data.fd);
#endif
TIFFSetClientdata(faxTIFF, (thandle_t) &client_data);
TIFFSetFileName(faxTIFF, (const char*)argv[optind]);
TIFFSetField(out, TIFFTAG_IMAGEWIDTH, xsize);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 1);