[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
This commit is contained in:
Fabien Bodard 2014-12-21 21:26:04 +00:00
parent 23179c7340
commit 97465d098a
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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