diff --git a/pano-split.sh b/pano-split.sh index a8bc901..e99d4e8 100644 --- a/pano-split.sh +++ b/pano-split.sh @@ -7,43 +7,68 @@ # very naive linear manner. infile="$1" +outfile="$2" +model="$3" +printsize="$4" + +if [ -z "$5" ] ; then + dpi=300 +else + dpi="$5" +fi # D90 -dpi=300 -cols=1852 -drows=2428 -overlap=600 -## 6x20 3-pane -inrows=6084 -## 6x14 2-pane -#inrows=4256 - -#DS620 -#dpi=300 -#cols=1844 -#drows=2436 -#overlap=600 -## 6x20 3-page -#inrows=6108 -## 6x14 2-page -#inrows=4272 - -#DS820 -#dpi=300 -#overlap=600 -#cols=2448 -## 8x18 2-pane -#drows=3036 -#inrows=5472 -## 8x26 3-pane -#drows=3036 -#inrows=7908 -## 8x22 2-pane -#drows=3636 -#inrows=6672 -## 8x32 3-pane -#drows=3636 -#inrows=9708 +case "${model}" in + mitsubishi-d90dw) + cols=1852 + drows=2428 + overlap=600 + if [ "${printsize}" eq "6x20" ] ; then + inrows=6084 + elif [ "${printsize}" eq "6x14" ] ; then + inrows=4256 + else + echo "D90 supportx 6x20 and 6x14 only" + exit 1 + fi + ;; + dnp-ds620) + cols=1844 + drows=2436 + overlap=600 + if [ "${printsize}" eq "6x20" ] ; then + inrows=6108 + elif [ "${printsize}" eq "6x14" ] ; then + inrows=4272 + else + echo "DS620 supportx 6x20 and 6x14 only" + exit 1 + fi + ;; + dnp-ds820) + overlap=600 + cols=2448 + if [ "${printsize}" eq "8x18" ] ; then + drows=3036 + inrows=5472 + elif [ "${printsize}" eq "8x26" ] ; then + drows=3036 + inrows=7908 + elif [ "${printsize}" eq "8x22" ] ; then + drows=3636 + inrows=6672 + elif [ "${printsize}" eq "8x32" ] ; then + drows=3636 + inrows=9708 + else + echo "DS820 supportx 8x18, 8x26, 8x22, and 8x32 only" + fi + ;; + *) + echo "Unsupported model!" + exit 1 + ;; +esac # For 600dpi, double everything! if [ ${dpi} == 600 ] ; then @@ -108,4 +133,4 @@ done rm ${fadeinname} ${fadeoutname} ## Create PDF -gm convert -density ${dpi}x${dpi} ${panels} out.pdf +gm convert -density ${dpi}x${dpi} ${panels} ${outfile} diff --git a/regression-gp.csv b/regression-gp.csv index fde59c7..a6b018e 100644 --- a/regression-gp.csv +++ b/regression-gp.csv @@ -1,4 +1,4 @@ -#gp_printername,vid,pid,type,gp_options +#gp_printername,vid,pid,type,gp_options[,pano_options] # # The goal here is to cover unique models within gutenprint itself. # All print sizes need to be covered. diff --git a/regression-gp.pl b/regression-gp.pl index 895b817..2f7feaf 100755 --- a/regression-gp.pl +++ b/regression-gp.pl @@ -48,6 +48,8 @@ my $rotor = 0; my $rotor_circ = 0; my $row = 0; +my $pano_mode = 0; + my $quiet = 1; my $proc_count = 0; my @children = (); @@ -59,6 +61,7 @@ my $convert_exec = "/usr/bin/convert"; my $pdftoraster_exec = "/usr/lib/cups/filter/pdftoraster"; my $rastertogutenprint_exec = "/usr/lib/cups/filter/rastertogutenprint.5.3"; my $backend_exec = "./dyesub_backend"; +my $pano_exec = "./pano-split.sh"; $ENV{"STP_SUPPRESS_VERBOSE_MESSAGES"} = 1; $ENV{"OMP_NUM_THREADS"} = 1; @@ -149,6 +152,13 @@ if ($proc_count > 1 && $kid > 0) { $options .= "$x "; } + # See if we're in panorama mode + if (defined($row[5])) { + $pano_mode = 1; + pop(@pages_set); # 1 "page" + pop(@copies_set); # 1 copy + } + my $rval; my @args; @@ -179,22 +189,39 @@ if ($proc_count > 1 && $kid > 0) { } foreach my $pages (@pages_set) { - # generate PDF. - @args = ($convert_exec); - for (my $i = 0 ; $i < $pages ; $i++) { - push(@args, $input_image); - } - push(@args, "-density"); - push(@args, "300x300"); - push(@args, "${work_dir}$currow-${gp_name}.pdf"); - if (!$quiet) { - print join(":", @args) . "\n"; - } - $rval = run \@args; - if (!$rval) { - print("***** $row[0] $row[1] $row[2] $row[3] '$row[4]' FAIL: convert: $? -- " . join(":", @args) . "\n"); - $error++; - next; + if ($pano_mode) { + # XXX generate panorama bitmap + my $pano_tmp = $input_image; # XXX + + # Generate PDF by running through script. + @args = ($pano_exec, $pano_tmp, "${work_dir}$currow-${gp_name}.pdf", $gp_name, $row[5]); + if (!$quiet) { + print join(":", @args) . "\n"; + } + $rval = run \@args; + if (!$rval) { + print("***** $row[0] $row[1] $row[2] $row[3] '$row[4]' '$row[5]' FAIL: pano-split.sh: $? -- " . join(":", @args) . "\n"); + $error++; + next; + } + } else { + # generate PDF. + @args = ($convert_exec); + for (my $i = 0 ; $i < $pages ; $i++) { + push(@args, $input_image); + } + push(@args, "-density"); + push(@args, "300x300"); + push(@args, "${work_dir}$currow-${gp_name}.pdf"); + if (!$quiet) { + print join(":", @args) . "\n"; + } + $rval = run \@args; + if (!$rval) { + print("***** $row[0] $row[1] $row[2] $row[3] '$row[4]' FAIL: convert: $? -- " . join(":", @args) . "\n"); + $error++; + next; + } } # Generate raster from PDF