From 2c88495cf3709ad5905a1af125a809b61525f08b Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 20 Dec 2006 14:50:11 +0100 Subject: [PATCH] put pbm call in subroutine. --- scm/ps-to-png.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm index 4f6d322e48..9959afdbfe 100644 --- a/scm/ps-to-png.scm +++ b/scm/ps-to-png.scm @@ -90,16 +90,19 @@ 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) -- 2.39.5