X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fps-to-png.scm;h=caffb9aeda8d3dd717d607917684cddaf9a009b6;hb=f875ef39c544bd3499dae5360e9e24f69933575f;hp=76773ab9ce8e071d6064b2342c9e691896536433;hpb=e18531db1f79fb685fbd16d6a2a67bf4b6c09915;p=lilypond.git diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index 76773ab9ce..caffb9aeda 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2005--2010 Jan Nieuwenhuizen +;;;; Copyright (C) 2005--2011 Jan Nieuwenhuizen ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -27,10 +27,9 @@ (lily) ) -;; gettext wrapper for guile < 1.7.2 -(if (defined? 'gettext) - (define-public _ gettext) - (define-public (_ x) x)) +;; FIXME: use backend-library for duplicates and stubs; lilypond-ps2png.scm is no more + +(define-public _ gettext) (define PLATFORM (string->symbol @@ -85,7 +84,7 @@ (my-system be-verbose #t (format #f - "pngtopnm ~a | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > ~a" + "pngtopnm \"~a\" | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > \"~a\"" old factor file)) (delete-file old))) @@ -112,7 +111,7 @@ (pixmap-format 'png16m) (anti-alias-factor 1)) - (let* ((format-str (format "~a" pixmap-format)) + (let* ((format-str (format #f "~a" pixmap-format)) (extension (cond ((string-contains format-str "png") "png") ((string-contains format-str "jpg") "jpeg") @@ -120,17 +119,17 @@ (else (ly:error "Unknown pixmap format ~a" pixmap-format)))) (base (dir-basename ps-name ".ps" ".eps")) - (png1 (format "~a.~a" base extension)) - (pngn (format "~a-page%d.~a" base extension)) + (png1 (format #f "~a.~a" base extension)) + (pngn (format #f "~a-page%d.~a" base extension)) (page-count (ps-page-count ps-name)) (multi-page? (> page-count 1)) (output-file (if multi-page? pngn png1)) (gs-variable-options - (if multi-page? - (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f" - page-width page-height) - "-dEPSCrop")) + (if (string-suffix-ci? ".eps" ps-name) + "-dEPSCrop" + (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f" + page-width page-height))) (cmd (ly:format "~a\ ~a\ ~a\ @@ -164,9 +163,9 @@ (if multi-page? (map (lambda (n) - (format "~a-page~a.png" base (1+ n))) + (format #f "~a-page~a.png" base (1+ n))) (iota page-count)) - (list (format "~a.png" base)))) + (list (format #f "~a.png" base)))) (if (not (= 0 status)) (begin