summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm17
1 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 622c85bbc..9255411c9 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -1526,10 +1526,19 @@ sub print_pages($@) {
# Only text and PostScript can be printed directly with all spoolers,
# images must be treated seperately
if ($page =~ /\.jpg$/) {
- system(($::testing ? $prefix : "chroot $prefix/ ") .
- "/usr/bin/convert $page -page 427x654+100+65 PS:- | " .
- ($::testing ? $prefix : "chroot $prefix/ ") .
- "$lpr -s $printer->{SPOOLER} -P $queue");
+ if ($printer->{SPOOLER} ne "cups") {
+ # Use "convert" from ImageMagick for non-CUPS spoolers
+ system(($::testing ? $prefix : "chroot $prefix/ ") .
+ "/usr/bin/convert $page -page 427x654+100+65 PS:- | " .
+ ($::testing ? $prefix : "chroot $prefix/ ") .
+ "$lpr -s $printer->{SPOOLER} -P $queue");
+ } else {
+ # Use CUPS's internal image converter with CUPS, tell it
+ # to let the image occupy 90% of the page size (so nothing
+ # gets cut off by unprintable borders)
+ run_program::rooted($prefix, $lpr, "-s", $printer->{SPOOLER},
+ "-P", $queue, "-o", "scaling=90", $page);
+ }
} else {
run_program::rooted($prefix, $lpr, "-s", $printer->{SPOOLER},
"-P", $queue, $page);