diff -u gscan2pdf-1.0.4/debian/changelog gscan2pdf-1.0.4/debian/changelog
--- gscan2pdf-1.0.4/debian/changelog
+++ gscan2pdf-1.0.4/debian/changelog
@@ -1,3 +1,12 @@
+gscan2pdf (1.0.4-5) unstable; urgency=low
+
+  * Add support for unpaper > 0.3
+    Closes: #680158 (Incompatible with unpaper 0.4.2)
+  * Fix applying default settings with CLI frontends
+    Closes: #682818 (Presets aren't working)
+
+ -- Jeffrey Ratcliffe <jjr@debian.org>  Tue, 31 Jul 2012 16:14:59 +0200
+
 gscan2pdf (1.0.4-4) unstable; urgency=low
 
   * Recommend tesseract OR gocr OR cuneiform, rather than AND
diff -u gscan2pdf-1.0.4/debian/patches/series gscan2pdf-1.0.4/debian/patches/series
--- gscan2pdf-1.0.4/debian/patches/series
+++ gscan2pdf-1.0.4/debian/patches/series
@@ -4,0 +5,2 @@
+unpaper-0.4
+0001-Fix-applying-default-settings-to-widgets-in-scanimag.patch
only in patch2:
unchanged:
--- gscan2pdf-1.0.4.orig/debian/patches/0001-Fix-applying-default-settings-to-widgets-in-scanimag.patch
+++ gscan2pdf-1.0.4/debian/patches/0001-Fix-applying-default-settings-to-widgets-in-scanimag.patch
@@ -0,0 +1,20 @@
+From 729cdba92b53b54c34c4db5700042c9d364c69a2 Mon Sep 17 00:00:00 2001
+From: Jeffrey Ratcliffe <Jeffrey.Ratcliffe@gmail.com>
+Date: Thu, 26 Jul 2012 22:49:20 +0200
+Subject: [PATCH] Fix applying default settings to widgets in scanimage dialog
+
+---
+ bin/gscan2pdf    |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/bin/gscan2pdf
++++ b/bin/gscan2pdf
+@@ -7063,7 +7063,7 @@
+ 
+    # only set the default if it is an option
+    and (
+-    defined( $option->{max} )
++    defined( $option->{constraint}{max} )
+     or defined(
+      default2index( $SETTING{ $option->{name} }, @{ $option->{values} } )
+     )
only in patch2:
unchanged:
--- gscan2pdf-1.0.4.orig/debian/patches/unpaper-0.4
+++ gscan2pdf-1.0.4/debian/patches/unpaper-0.4
@@ -0,0 +1,69 @@
+From 8fd9c32f9dc8645d85fe9caef4c71fdf37e6284d Mon Sep 17 00:00:00 2001
+From: Jeffrey Ratcliffe <Jeffrey.Ratcliffe@gmail.com>
+Date: Fri, 20 Jul 2012 14:35:14 +0200
+Subject: [PATCH] + support for unpaper > 0.3
+
+---
+ lib/Gscan2pdf.pm         |    4 ++--
+ lib/Gscan2pdf/Unpaper.pm |   18 ++++++++++++++++--
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+--- a/lib/Gscan2pdf/Unpaper.pm
++++ b/lib/Gscan2pdf/Unpaper.pm
+@@ -6,6 +6,7 @@
+ use Carp;
+ use Glib qw(TRUE FALSE);    # To get TRUE and FALSE
+ use Gtk2 -init;
++use version;
+ 
+ BEGIN {
+  use Exporter ();
+@@ -22,6 +23,7 @@
+ 
+ # Window parameters
+ my $border_width = 6;
++my $version;
+ 
+ sub new {
+  my ( $class, $default ) = @_;
+@@ -213,6 +215,10 @@
+    default => 0.33,
+   },
+  };
++ unless ( defined $version ) {
++  $version = `unpaper --version`;
++  chomp($version);
++ }
+  bless( $self, $class );
+  return $self;
+ }
+@@ -517,7 +523,16 @@
+      if ( defined $default->{$option} );
+   }
+  }
+- return join ' ', @items;
++ my $cmd = 'unpaper ' . join( ' ', @items ) . ' --overwrite ';
++ $cmd .=
++   version->parse($version) > '0.3.0'
++   ? '%s %s %s'
++   : '--input-file-sequence %s --output-file-sequence %s %s';
++ return $cmd;
++}
++
++sub version {
++ return $version;
+ }
+ 
+ 1;
+--- a/lib/Gscan2pdf.pm
++++ b/lib/Gscan2pdf.pm
+@@ -1317,8 +1317,7 @@
+  ) if ( $options =~ /--output-pages 2 / );
+ 
+  # --overwrite needed because $out exists with 0 size
+- my $cmd =
+-"unpaper $options --overwrite --input-file-sequence $in --output-file-sequence $out $out2;";
++ my $cmd = sprintf "$options;", $in, $out, $out2;
+  $logger->info($cmd);
+  system("echo $$ > $pidfile;$cmd");
+  return if $_self->{cancel};
