From dd89dd5ac1fbc25b440b2b88cfc440ac54f6df70 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 1 Mar 2017 09:33:32 -0700 Subject: handle Auto paper size --- Main.hs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Main.hs b/Main.hs index ac80935..d4fa299 100644 --- a/Main.hs +++ b/Main.hs @@ -139,17 +139,19 @@ scanimageArgs st = Colour -> "Color" Greyscale -> "Gray" Lineart -> "Lineart" - , "-x" - , show $ case st^.stPaper of - A4 -> 210 - Letter -> 215.9 - Photo -> 150 - , "-y" - , show $ case st^.stPaper of - A4 -> 297 - Letter -> 279.4 - Photo -> 100 - ] + ] ++ case st^.stPaper of + Auto -> ["--swcrop=yes"] + _ -> [ "-x" + , show $ case st^.stPaper of + A4 -> 210 + Letter -> 215.9 + Photo -> 150 + , "-y" + , show $ case st^.stPaper of + A4 -> 297 + Letter -> 279.4 + Photo -> 100 + ] -- other device-specific scanimage options the old script supported: -- --swdespeck; --color-filter; --depth -- cgit v1.2.3