Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Scanning fails "bad request" #7

Open
PhatPhantom opened this issue May 11, 2019 · 4 comments
Open

Scanning fails "bad request" #7

PhatPhantom opened this issue May 11, 2019 · 4 comments

Comments

@PhatPhantom
Copy link

`python /var/www/html/scan.py scans/Scan20190511072948.jpg 300
Found scanner 'HP LaserJet MFP M130nw (Bonjour)._uscan._tcp.local.' at 'NPIA9BA52.local.'
Scanner information:

<scan:ScannerCapabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:scan="http://schemas.hp.com/imaging/escl/2011/05/03" xmlns:pwg="http://www.pwg.org/schemas/2010/12/sm" xsi:schemaLocation="http://schemas.hp.com/imaging/escl/2011/05/03 eSCL.xsd">
pwg:Version2.5</pwg:Version>
pwg:MakeAndModelHP LaserJet MFP M130nw</pwg:MakeAndModel>
pwg:SerialNumberVNB4D07779</pwg:SerialNumber>
scan:Platen
scan:PlatenInputCaps
scan:MinWidth576</scan:MinWidth>
scan:MaxWidth2550</scan:MaxWidth>
scan:MinHeight576</scan:MinHeight>
scan:MaxHeight3508</scan:MaxHeight>
scan:MaxScanRegions1</scan:MaxScanRegions>
scan:SettingProfiles
scan:SettingProfile
scan:ColorModes
scan:ColorModeRGB24</scan:ColorMode>
scan:ColorModeGrayscale8</scan:ColorMode>
</scan:ColorModes>
scan:ContentTypes
pwg:ContentTypePhoto</pwg:ContentType>
pwg:ContentTypeText</pwg:ContentType>
pwg:ContentTypeTextAndPhoto</pwg:ContentType>
</scan:ContentTypes>
scan:DocumentFormats
pwg:DocumentFormatimage/jpeg</pwg:DocumentFormat>
pwg:DocumentFormatapplication/pdf</pwg:DocumentFormat>
scan:DocumentFormatExtimage/jpeg</scan:DocumentFormatExt>
scan:DocumentFormatExtapplication/pdf</scan:DocumentFormatExt>
</scan:DocumentFormats>
scan:SupportedResolutions
scan:DiscreteResolutions
scan:DiscreteResolution
scan:XResolution75</scan:XResolution>
scan:YResolution75</scan:YResolution>
</scan:DiscreteResolution>
scan:DiscreteResolution
scan:XResolution200</scan:XResolution>
scan:YResolution200</scan:YResolution>
</scan:DiscreteResolution>
scan:DiscreteResolution
scan:XResolution300</scan:XResolution>
scan:YResolution300</scan:YResolution>
</scan:DiscreteResolution>
scan:DiscreteResolution
scan:XResolution600</scan:XResolution>
scan:YResolution600</scan:YResolution>
</scan:DiscreteResolution>
scan:DiscreteResolution
scan:XResolution1200</scan:XResolution>
scan:YResolution1200</scan:YResolution>
</scan:DiscreteResolution>
</scan:DiscreteResolutions>
</scan:SupportedResolutions>
scan:ColorSpaces
scan:ColorSpacesRGB</scan:ColorSpace>
</scan:ColorSpaces>
</scan:SettingProfile>
</scan:SettingProfiles>
scan:SupportedIntents
scan:IntentDocument</scan:Intent>
scan:IntentPhoto</scan:Intent>
scan:IntentPreview</scan:Intent>
scan:IntentTextAndGraphic</scan:Intent>
</scan:SupportedIntents>
scan:MaxOpticalXResolution1200</scan:MaxOpticalXResolution>
scan:MaxOpticalYResolution1200</scan:MaxOpticalYResolution>
</scan:PlatenInputCaps>
</scan:Platen>
scan:ContrastSupport
scan:Min-127</scan:Min>
scan:Max127</scan:Max>
scan:Normal0</scan:Normal>
scan:Step1</scan:Step>
</scan:ContrastSupport>
</scan:ScannerCapabilities>

Our scan request:

<scan:ScanSettings xmlns:pwg="http://www.pwg.org/schemas/2010/12/sm" xmlns:scan="http://schemas.hp.com/imaging/escl/2011/05/03">
pwg:Version2.6</pwg:Version>
pwg:ScanRegions
pwg:ScanRegion
pwg:XOffset0</pwg:XOffset>
pwg:YOffset0</pwg:YOffset>
pwg:Width2550</pwg:Width>
pwg:Height3508</pwg:Height>
pwg:ContentRegionUnitsescl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>
</pwg:ScanRegion>
</pwg:ScanRegions>
scan:InputSourcePlaten</scan:InputSource>
scan:ColorModeRGB24</scan:ColorMode>
scan:XResolution300</scan:XResolution>
scan:YResolution300</scan:YResolution>
</scan:ScanSettings>

400

Cache-Control: no-cache, no-store, must-revalidate
Server: gSOAP/2.7
Content-Length: 0
Connection: close

Bad Request
`

@kno10
Copy link
Owner

kno10 commented May 12, 2019

As documented this is only a proof of concept.
For your individual scanner, you may need to customize the request, to include all parameters that the scanner expects to see. For example, I do not see the content units in your scanners capabilities.

@PhatPhantom
Copy link
Author

well, I have nothing to compare to here . Can you tell me what XML is submitted to what URL to get those capabilities?

I found this URL http://scannerip/eSCL/ScannerCapabilities but do not know what xml to sumbit . This may make it easier so I can take a peek at what some other eSCL scanners return.

@kno10
Copy link
Owner

kno10 commented May 15, 2019

The XML you copy&pasted above is the information you need to work with.
Try adding scan parameters from that list, and removing parameters that are not in that list.
I don't know of any documentation for eSCL scanning, sorry.

@kno10
Copy link
Owner

kno10 commented May 15, 2019

And when you find a working combination, please share what you found.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants