X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fps-to-png.scm;h=5e78d0c7c0d3997267972f5d11053a3cc0d8bbb5;hb=b948cd133c780173f1a0b10378091ac9b4ad119b;hp=4436ea3fbbed95543b4fe83becaf21da8f113f50;hpb=1c846b2c2348b4e0ca4a3c2e8fb267047ba2d203;p=lilypond.git diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index 4436ea3fbb..5e78d0c7c0 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--2011 Jan Nieuwenhuizen +;;;; Copyright (C) 2005--2012 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,6 +27,8 @@ (lily) ) +;; FIXME: use backend-library for duplicates and stubs; lilypond-ps2png.scm is no more + (define-public _ gettext) (define PLATFORM @@ -61,15 +63,11 @@ ;; copy of ly:system. ly:* not available via lilypond-ps2png.scm (define (my-system be-verbose exit-on-error cmd) (define status 0) - (if be-verbose - (begin - (format (current-error-port) (_ "Invoking `~a'...") cmd) - (newline (current-error-port)))) + (ly:debug (_ "Invoking `~a'...\n") cmd) (set! status (system cmd)) (if (not (= status 0)) (begin - (format (current-error-port) - (format #f (_ "~a exited with status: ~S") "GS" status)) + (ly:error (_ "~a exited with status: ~S") "GS" status) (if exit-on-error (exit 1)))) status) @@ -82,7 +80,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))) @@ -109,7 +107,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") @@ -117,8 +115,8 @@ (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)) @@ -161,9 +159,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