Refactoring the optimize code in version 1.5.0 and the removal of the LOG_FH macro caused a regression where certain stats and debug statements are always printed to stdout, even if it is being used for output with the --stdout flag.
In particular, when --stdout is used without --stdin (so reading from a file, outputting to a stream), every log is sent to stdout and intermixed with the image data, so jpegoptim image.jpg --stdout > image-opt.jpg produces broken files.
This patch fixes those cases by bringing back the LOG_FH macro.
Refactoring the
optimize
code in version 1.5.0 and the removal of theLOG_FH
macro caused a regression where certain stats and debug statements are always printed to stdout, even if it is being used for output with the--stdout
flag. In particular, when--stdout
is used without--stdin
(so reading from a file, outputting to a stream), every log is sent to stdout and intermixed with the image data, sojpegoptim image.jpg --stdout > image-opt.jpg
produces broken files.This patch fixes those cases by bringing back the
LOG_FH
macro.