]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove ps-has-color, use compression 9 for pngs.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 17 Dec 2006 22:11:47 +0000 (23:11 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 17 Dec 2006 22:11:47 +0000 (23:11 +0100)
scm/ps-to-png.scm

index 19473b9a638fa08c559bbffb319a7693edaa7207..4f6d322e4825a69b55ca30a3002cc922c2028601 100644 (file)
@@ -48,9 +48,6 @@
     str))
 
 (define-public (gulp-file file-name . max-size)
-  ;; string routines barf when strlen() != string-length,.
-  ;; which may happen as side effect of read-string!/partial.
-  ;;  (gulp-port (open-file nm "r") len))
   (ly:gulp-file file-name (if (pair? max-size) (car max-size))))
 
 (define BOUNDING-BOX-RE
 
 (define (scale-down-image be-verbose factor file)
   (let* ((status 0)
-        ;;(percentage (* 100 (/ 1.0 factor)))
         (old (string-append file ".old")))
 
     (rename-file file old)
     (my-system
      be-verbose #t
-     ;; convert -scale creates (a large rgb) png from a grayscale
-     ;; (format #f "convert -scale \"~a%\" -depth 8 ~a ~a" percentage old file))
-
-     (format #f "pngtopnm ~a | pnmscale -reduce ~a | pnmtopng > ~a" old factor file))
+     (format #f
+            "pngtopnm ~a | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > ~a"
+            old factor file))
     (delete-file old)))
 
 (define-public (ps-page-count ps-name)
                                  header))))
     (if match (string->number (match:substring match 1)) 0)))
 
-(define-public (ps-has-color ps-name)
-  (string-contains (gulp-file ps-name) " setrgbcolor"))
-
 (define-public (make-ps-images ps-name . rest)
   (let-keywords*
    rest #f