From 97465d098af4e5bb0ad38472c70d52c5afa2fcbc Mon Sep 17 00:00:00 2001 From: Fabien Bodard Date: Sun, 21 Dec 2014 21:26:04 +0000 Subject: [PATCH] [GB.SCANNER] * BUG: All parameters sended to scanimage are quoted now, if they are text. git-svn-id: svn://localhost/gambas/trunk@6760 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.scanner/.src/MTest.module | 1 + comp/src/gb.scanner/.src/Scanner.class | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/comp/src/gb.scanner/.src/MTest.module b/comp/src/gb.scanner/.src/MTest.module index d20dcfef8..607dc4fb5 100644 --- a/comp/src/gb.scanner/.src/MTest.module +++ b/comp/src/gb.scanner/.src/MTest.module @@ -7,6 +7,7 @@ Dim hImg As Image 'Dim hscan As New Scanner("hpaio:/net/HP_LaserJet_M1536dnf_MFP?ip=192.168.1.25") Dim hscan As New Scanner("v4l:/dev/video0") +hscan.Debug = True hScan["Mode"].Value = "color" 'hScan[" Resolution "].Value = 30 hScan!Width.Value = 2560 diff --git a/comp/src/gb.scanner/.src/Scanner.class b/comp/src/gb.scanner/.src/Scanner.class index 38679cee5..13c65ec89 100644 --- a/comp/src/gb.scanner/.src/Scanner.class +++ b/comp/src/gb.scanner/.src/Scanner.class @@ -38,7 +38,7 @@ Event Progress Public Sub _New(sDevice As String) - $sDeviceName = "--device-name=" & sDevice + $sDeviceName = "--device-name='" & sDevice & "'" $sName = sDevice If Not IsAvailable() Then Error.Raise("Unknown Device") @@ -96,7 +96,7 @@ Private Sub GetOptions() '$Options = New _Options $aOptionsNames = New String[] $aOptions = New _Option[] - Exec ["scanimage", $sDeviceName, "-A"] To sRet + Shell "scanimage " & $sDeviceName & " -A" To sRet 'Return For Each s In Split(sRet, "\n") s = Trim(s) @@ -222,9 +222,9 @@ Public Function Scan() As Image If hOption.Modified Then If hOption._Command Begins "--" Then - sOptions &= hOption._Command & "=" & hOption.Value & " " + sOptions &= hOption._Command & "=" & IIf(hOption.IsRange, hOption.Value, "'" & hOption.Value & "'") & " " Else - sOptions &= hOption._Command & " " & hOption.Value & " " + sOptions &= hOption._Command & " " & IIf(hOption.IsRange, hOption.Value, "'" & hOption.Value & "'") & " " Endif Endif