From 1f8c40c86902c6c98091ccfd3ecf02ec1fc2bed5 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Thu, 17 Jun 2010 15:41:52 -0700 Subject: [PATCH] ps-to-png.scm: only use -dEPSCrop for EPS files. 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. --- scm/ps-to-png.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index f25f8cb7ff..cbe6d23e4b 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -124,10 +124,11 @@ (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\ -- 2.39.2