The previous check for multi-page documents fails to account for
single-page PS files, which must have page sizes specified using
-dDEVICEWIDTHPOINTS and -dDEVICEHEIGHTPOINTS when converted to PNG.
This commit improves the situation: only use the -dEPSCrop option for
EPS files, which do not have a page count. All files that specify a
page count (PS files), will now be converted to PNGs with correct
dimensions.
(output-file (if multi-page? pngn png1))
(gs-variable-options
(output-file (if multi-page? pngn png1))
(gs-variable-options
- (if multi-page?
- (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
- page-width page-height)
- "-dEPSCrop"))
+ ;; ps-page-count returns 0 for EPS files
+ (if (zero? page-count)
+ "-dEPSCrop"
+ (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
+ page-width page-height)))
(cmd (ly:format "~a\
~a\
~a\
(cmd (ly:format "~a\
~a\
~a\