ImageMagick / ImageMagick6

🧙‍♂️ ImageMagick 6
https://legacy.imagemagick.org
Other
194 stars 80 forks source link

Delegate stderr should not be directly to identify stderr #316

Open crass opened 3 months ago

crass commented 3 months ago

Is your feature request related to a problem? Please describe.

When using identify on a PDF file, ghostscript is delegated to. By default the command sends ghostscripts stdout to identify's stderr. The output is confusing and undesirable.

Describe the solution you'd like

In the case above, the output of ghostscript should go to a logging channel named "Delegate". So the output is not shown by default, but can be show by turning on the appropriate logging.

Describe alternatives you've considered

Additional context

Here's illustrative output:

$ identify test.pdf
   **** Error: /BBox has zero width or height, which is not allowed.
               Output may be incorrect.
   **** Error: /BBox has zero width or height, which is not allowed.
               Output may be incorrect.
   **** Error: /BBox has zero width or height, which is not allowed.
               Output may be incorrect.
   **** Error: /BBox has zero width or height, which is not allowed.
               Output may be incorrect.
   **** Error: /BBox has zero width or height, which is not allowed.
               Output may be incorrect.
   **** Error: /BBox has zero width or height, which is not allowed.
               Output may be incorrect.
test.pdf[0] PDF 432x648 432x648+0+0 16-bit sRGB 53235B 0.100u 0:00.107
test.pdf[1] PDF 432x648 432x648+0+0 16-bit sRGB 46977B 0.100u 0:00.102
test.pdf[2] PDF 432x648 432x648+0+0 16-bit sRGB 48116B 0.090u 0:00.098
test.pdf[3] PDF 432x648 432x648+0+0 16-bit sRGB 46065B 0.090u 0:00.093
test.pdf[4] PDF 432x648 432x648+0+0 16-bit sRGB 50692B 0.080u 0:00.089
test.pdf[5] PDF 432x648 432x648+0+0 16-bit sRGB 49412B 0.080u 0:00.085

The **** Error lines come from ghostscript and there is no way to disable this output without editing delegates.xml or throwing away all of identify's stderr.