]> git.donarmstrong.com Git - lilypond.git/commitdiff
put pbm call in subroutine.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 20 Dec 2006 13:50:11 +0000 (14:50 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 20 Dec 2006 13:50:11 +0000 (14:50 +0100)
scm/ps-to-png.scm

index 4f6d322e4825a69b55ca30a3002cc922c2028601..9959afdbfe6f48b24da675dfbdc713c7dc61f23a 100644 (file)
   status)
 
 (define (scale-down-image be-verbose factor file)
-  (let* ((status 0)
-        (old (string-append file ".old")))
-
-    (rename-file file old)
-    (my-system
-     be-verbose #t
-     (format #f
-            "pngtopnm ~a | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > ~a"
-            old factor file))
-    (delete-file old)))
+  (define (with-pbm)
+    (let* ((status 0)
+          (old (string-append file ".old")))
+      
+      (rename-file file old)
+      (my-system
+       be-verbose #t
+       (format #f
+              "pngtopnm ~a | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > ~a"
+              old factor file))
+      (delete-file old)))
+
+  (with-pbm))
 
 (define-public (ps-page-count ps-name)
   (let* ((byte-count 10240)