Created attachment 19522 [details] Input test file. With the attached image `foo.eps`, calling ``` gs -sDEVICE=png16m \ -o foo.png \ -dDEVICEWIDTHPOINTS=600 \ -dDEVICEHEIGHTPOINTS=601 \ -dGraphicsAlphaBits=4 \ -dTextAlphaBits=4 \ -dEPSFitPage=true \ foo.eps ``` results in an empty, framed box. If the height is set equal to or smaller than the width, I get a properly converted image. Is this expected? At least while reading the documentation I couldn't find such a limitation.
Created attachment 19523 [details] PNG test output.
Created attachment 19539 [details] Patch Bug 702607: Simplify and fix a procedure that scales EPS to fit the page. The EPS file is rotated to have the same orientation, scaled to fit the most restrictive dimension of the printable area and centred in the other dimension.
This looks great, thanks! However, I would very much like to have an option that does *not* rotate the image. Is that possible?
Created attachment 19540 [details] A patch with optional rotation It is easy to make rotation dependent on a global flag. In this case -dNOEPSROTATION disables rotation. You are free to use this patch locally but I cannot guarantee that this change in Ghostscript UI will be accepted.
Patch pushed. Thank you Peter. I really like the style of the implementation and the commenting. I am not closing this yet because we are going to discuss the option for not rotating and we'll close it then, possibly after adding that, and also adding it to the PDFFitPage option. We are leaning on having an option something like AllowFitRotation that defaults to 'true', so -dAllowFitRotation=false to get the result the submitter wants.
Note there was also a later patch for bug 702995 that also affects EPS page fitting.
Thanks a lot for fixing this! Will the `-dNOEPSROTATION` command line option be available from now on? Or is it replaced with '-dAllowFitRotation=false'?