AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2019.10.01 18:01 "[Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.01 19:10 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Bob Friesenhahn
2019.11.03 18:13 "[Tiff] libtiff, breaking with release traditions", by Bob Friesenhahn
2019.11.03 22:52 "[Tiff] Libtiff 4.1.0 is released", by Bob Friesenhahn
2019.10.01 19:37 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Roger Leigh
2019.10.01 21:42 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Bob Friesenhahn
2019.10.01 21:57 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Olivier Paquet
2019.10.02 02:39 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 12:10 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 12:14 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Edward Lam
2019.10.10 12:38 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Olivier Paquet
2019.10.10 14:21 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 14:28 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 18:41 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Roger Leigh
2019.10.10 19:11 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Even Rouault
2019.10.10 19:40 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Bob Friesenhahn
2019.10.10 22:24 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 22:42 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Scott Ribe
2019.10.10 14:23 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 12:25 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Scott Ribe
2019.10.10 14:22 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.11 02:55 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Edward Lam
2019.10.02 12:29 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Edward Lam
2019.10.02 13:14 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.02 13:29 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Bob Friesenhahn
2019.10.10 10:28 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by David C. Partridge
2019.10.10 11:28 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Edward Lam
2019.10.02 13:18 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Bob Friesenhahn

2019.10.01 19:37 "Re: [Tiff] TIFF_IO_MAX too large for Windows XP", by Roger Leigh

On 01/10/2019 19:01, David C. Partridge wrote:

After a lot of digging I found out why my code wasn't working when run in Windows XP (It was working fine of Window 7 and up)

In tif_unix.c the read() and write() calls were using TIFF_IO_MAX to set the maximum buffer size. Unfortunately when they were called with a request to read a large file the requested number of bytes to read was 170,769,911 bytes which resulted in read() returning -1 with errno set to EINVAL.

For now I have changed the #define for TIFF_IO_MAX thus:

//#define TIFF_IO_MAX 2147483647U
#define TIFF_IO_MAX USHRT_MAX

which limits the request size to 65535.

Does anyone know what the actual limit was on Windows XP? If higher than 65535 I'd like to increase the defined limit.

Would the libtiff maintainers consider changing this to an appropriate smaller value?

Hi David,

Did you try building with tif_win32.c instead of tif_unix.c?

For the change you made, would this not have quite negative performance implications for platforms supporting rather larger sizes?  This rather small when individual images can be many gigabytes.

I can see some documented limits here: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefile (nNumberOfBytesToWrite).  Whether they apply for your case, I don't know.

If this was to be supported, I think it would need to be set within an XP-specific #ifdef so that all the other platforms continue to use the larger size.

However, without wanting to sound too negative, Windows XP is thoroughly obsolete at this point.  It's five major releases behind, completely unsupported for over five years, and I don't see and value in expending effort in supporting and maintaining it in 2019. Same for Vista, also unsupported now for two years.  Extended support for 7 ends in January. https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet has the current lifecycles dates. If you need to support it, that's quite fine if you want to modify libtiff locally for your own use, but I'm unsure sure of the greater value in having such changes incorporated generally, especially if they will negatively effect currently supported platforms.  However, I'm willing to be persuaded if there are good reasons.

Kind regards,

Roger