]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4431 / 4: Add MinGW support of scale-down-image (ps-to-png.scm)
authorMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 1 Jun 2015 13:18:22 +0000 (22:18 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Sun, 14 Jun 2015 13:36:29 +0000 (22:36 +0900)
scale-down-image can work on MinGW by this commit.

scm/ps-to-png.scm

index 0d1e174ed61b9825ed9ca80df633c769a355e393..e890eaa746f52df2b5be0cd7a5d71f66e1e9be96 100644 (file)
          ;; outputs only standard output instead of a file.
          ;; So we need pipe and redirection.
          ;; However, ly:system can't handle them.
-         ;; Therefore, we use /bin/sh for handling them.
-         ;; FIXME: MinGW (except Cygwin) doesn't have /bin/sh.
+         ;; Therefore, we use ly:system-with-shell.
          (cmd
-          (list
-           "/bin/sh"
-           "-c"
-           (ly:format
-            "pngtopnm \"~a\" | pnmscale -reduce ~a | pnmtopng -compression 9 > \"~a\""
-            old factor file))))
+          (ly:format
+           "~a \"~a\" | ~a -reduce ~a | ~a -compression 9 > \"~a\""
+           (search-pngtopam) old
+           (search-pamscale) factor
+           (search-pnmtopng)
+           file)))
 
     (rename-file file old)
-    (ly:system cmd)
+    (ly:system-with-shell cmd)
     (delete-file old)))
 
 (define-public (ps-page-count ps-name)