-
Notifications
You must be signed in to change notification settings - Fork 24
Pyinsane doesn't complete scanning #29
Comments
Hm, weird. This message means your WIA driver requested an object type (C++) that Pyinsane is unable to provide ( https://github.com/jflesch/pyinsane/blob/stable/src/pyinsane2/wia/transfer.cpp#L159 ). The problem here is figuring which one. I'm going to push a patch later to see if we can get the name of the interface requested (note to myself: https://msdn.microsoft.com/en-us/library/windows/desktop/ms688692%28v=vs.85%29.aspx ). Regarding the empty |
Hi, The problem with the empty |
One thing that could be of help too is also the output of the script |
BTW, I assume you installed Pyinsane using python wheels ? Can you tell me which version it has installed please ? |
There is another thing you can try : You can try Paperwork. |
right, as soon as I return home I will do this and i post the results here.(probably by sunday) |
Hi there, My pyinsane version is 'pyinsane2==2.0.9' and the pillow version 'Pillow==4.0.0'. I'm uploading the output of the list_all example, there's a lot of option that don't match the constraints, i guess this can be the problem as you said. |
Hi, I tried with Paperwork and it worked. When I run teste.py it scan 2 pages and the stop. I guess the problem is to pyinsane to get the scanner signal inform if there's more pages on ADF or no. In Paperwork it scanned all the pages, but i had to inform paperwork the number of pages previosly. When a I run the teste.py it scan the first 2 pages and stops, I noticed that when it stops the last page scanned it's still in the ADF, and the ADF cylinder that pulls the next page is in position to pull the next page (and not in its rest position). After that, if i try to scan with paperwork the option "Scan from Feeder" is disabled. An if I run the teste.py again I get the error:
Well, that's it, I hope that it is just a configuration of the scanner problem. Thanks again for helping |
In Paperwork, the number of pages is purely informal. It's just so, at the end, the user can be sure that the expected number of page has been scanned (no pages going as a single one in the feeder, etc). How many pages are you trying to scan in total ? BTW, did you try the script
Well, that's a bug. I'm going to have a look. |
BTW, I forgot to specify: I've seen that drivers (Linux or Windows ..) tend to be really buggy and have really weird and annoying behaviors when something unexpected happens. When the behavior is becoming really odd (like in the last output you provided), you .. may have to restart your computer before retrying ... :/ |
I restarted my computer now and tried with Paperwork without setting the number of pages, the result was the same as the teste.py script, it stopped on the second page, with the bottom of the second sheet still in the ADF and the ADF cylinder in contact with the next sheet. I the tried again now setting the number of pages in Paperwork to 4 this way it scanned all the 4 sheets with no problem. I will restart everything and try the scan_adf.py and post what happened here |
Well, I tried with the scan_adf.py it scanned all the four pages (yay!) but it retirned an unknown error at the end =/. I'm uploading the output here. (i don't know if this will be an issue, i will try to convert the images to a pdf inside the script and if it worked I'm happy lol. |
I have a feeling it's not really a problem of indicating the number of pages to Paperwork, using your script or using scan_adf.py. With your scanner driver, it seems just random :-( Just a quick note : when I said the number of page doesn't matter to Paperwork, it's not exactly true actually .. if you ask for less pages than what is in the scanner feeder, it will stop as soon as it has what is wanted. (I should have specified that from the start I guess :/). The error you got at the end of scan_adf.py is 0x80210003 = WIA_ERROR_PAPER_EMPTY. |
36af5fd << I've added support for the error code returned by your driver. BTW, just to be sure, did you try your feeder with any other scanning application supporting it ? |
Hi, I did a few more tests, I still did'nt figure out what's causing the problem, but I guess i founded a solution. I'm uploading 2 python scripts the "scan" script is scanning only one page and the crashs with a error and the second page to be scanned stucked in the ADF. the "teste" scrip is working just fine, it scans all the pages and saves them. It still gives the error message:
but it scans all the images and I've doing the work i need without any problem The funny thing is that for me the 2 scripts are exactly the same, I copied the Thanx for the fixing of the error code. I installed the pyinsane via pip, if I clone your repo and compile the will it work? |
Except for the incorrect indentation in scan.txt (mix of tabs and 4-spaces), I can't see any difference between both scripts.
Yes, but it won't be easy. You need Visual C++ and WinDDK. I'll release a new version in the coming days and publish some Python wheels (usually Python 3.4 + 64 bits at least, but I guess I can make some more). It will probably be easier for you to install. |
Sorry, I forgot to tell you: I've released a version: 2.0.12 :/ |
Hi Jerome, Thanks for remembering me :) I've just updated to the new version, it's working almost sawa way it was working with the previous version. Here the problems I got so far:
these are what i've got so far, but it's fulfilling my needs, thanks again for the help! |
On Windows, this is expected. Pyinsane API doesn't really fit WIA API .. it's kind of putting a square peg into a round hole. So there are warnings ..
Hm, weird. Can you try with IronScanner please ? It is always built with the latest version of Pyinsane from Git. It will also get more traces, making debugging easier. |
Just made 3 tests with the IronScanner https://openpaper.work/en-us/scanner_db/report/99/ the first and second ones were with the flatbed and third one wit the feeder, it seems to me that it is scanning in color (based on the green circle in the image). In the last test I also fixed the manufacturer and the model to Lexmark mx410de |
@Feulo: I just want to be really clear on one thing: those reports are published publicly, scan included. Are you sure the documents you used are fine ? Looks like there is some info on one of them that could be private ? (I can delete them if you want me to) |
Hmm, when using the Flatbed, the scan was in color (as you said, there is a green circle correctly scanned). The resolution of 150dpi appears to be correctly set and correctly taken into account (the image has the expected size). And obviously maximize_scan_area() didn't crash. For reference, the code for scanning in IronScanner: https://github.com/openpaperwork/ironscanner/blob/eb4c48be2efa7d044e21ff0a03c58d52d2005eb4/src/ironscanner/main.py#L710 ( I'm going to take another look at your scripts later. |
The only info on them are my name, email and birthday, that are easily found on facebook, so no problem heheheh but thanks for the heads up I'll take a look in the reference code and do some tests here to. |
BTW, which version of Pyinsane is installed on your system ? |
Hi there,
I am trying to automate sccanning a batch of document with a script in python using Pyinsane2. But when I Call the scan_session = device.scan(multiple=True) routine I get the mesage "Pyinsane: Stream::QueryInterface(): Unknown interface requested" several times, and the python and if i press enter it returns an empty scan_sessions.images, and doesn't proceed to the next sheet.
I am using python 3.6 in a Windows 10 with WIA2, the scanner is a Lexmark all-in-one Mx410de and the connection is over lan.
Any guesses on How to fix this? Thanks
The text was updated successfully, but these errors were encountered: