2016.10.05 08:11 "[Tiff] Suppress warning about old-style JPEG compression", by John Brown

2016.10.07 21:28 "Re: [Tiff] Suppress warning about old-style JPEG compression", by John Brown

On Thursday, October 6, 2016 8:39 AM, Olivier Paquet wrote:

2016-10-06 8:01 GMT-04:00 John Brown <johnbrown105@hotmail.com>:

Would you say that it is a bug that on Windows the error message is displayed in a message box instead of written to stderr?

It is something which can be changed when libtiff is compiled. At the top of nmake.opt, you can find:

#

# Select WINMODE_CONSOLE to build a library which reports errors to stderr, or # WINMODE_WINDOWED to build such that errors are reported via MessageBox().

#
WINMODE_CONSOLE = 1
#WINMODE_WINDOWED = 1

But it might be easier to install an error handler which prints the errors to stderr than to rebuild or change your libtiff.

This issue applies to the 14 tiff*.exe, not just tiffcp. I see no reason for a command-line program to report errors via MessageBox(), but a GUI program may wish to do so. Since my main interest in libtiff, GraphicsMagick, poppler and others is their command line tools, it is better for me to rebuild libtiff.

At the top of nmake.opt after the copyright notice and the disclaimer it says

# Compile time parameter for MS Visual C++ compiler.

I built mylibtiff with MinGW/MSYS and my nmake.opt contains WINMODE_CONSOLE

#WINMODE_WINDOWED = 1

so configure definitely does not read this file. By reading tif_win32.c, I determined that I need to define TIF_PLATFORM_CONSOLE, but there seems to be no specific mechanism for that in configure, so I just added -DTIF_PLATFORM_CONSOLE=1 to my CPPFLAGS and tiffcp now writes errors to stderr.

Maybe adding the #define to tif_config.h after it is generated by configure would work. I did not try it.

Regards,
John Brown.