From: Jan Nieuwenhuizen Date: Sun, 17 Dec 2006 22:11:47 +0000 (+0100) Subject: Remove ps-has-color, use compression 9 for pngs. X-Git-Tag: release/2.11.3-1~14^2~1^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=30b9f4a55c986211145ec48e296603d836bd1739;p=lilypond.git Remove ps-has-color, use compression 9 for pngs. --- diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index 19473b9a63..4f6d322e48 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -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 @@ -94,16 +91,14 @@ (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) @@ -116,9 +111,6 @@ 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