Comments (4)
Please call pyinsane2.init()
only once from a single thread (for instance in your function Program()
). (same goes for pyinsane2.exit()
).
from pyinsane.
TestScanMultiple.txt
I moved all of the references to pyinsane2 outside of the threads but when i get to the section to start the scan in the any one of the threads:
try:
while True:
scan_session.scan.read()
except EOFError:
pass
i get another error:
===== RESTART: /home/pi/Documents/LinearBookScanner/TestScanMultiple.py =====
Device Id: 0Device Id: 1
Exiting in thread: 1Exiting in thread: 2
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/Documents/LinearBookScanner/TestScanMultiple.py", line 18, in Scan
scan_session.scan.read()
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 173, in read
return remote_do('scan_read', self._scanner_name)
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 69, in remote_do
result = os.read(fifo_s2c, length)
MemoryError
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/Documents/LinearBookScanner/TestScanMultiple.py", line 18, in Scan
scan_session.scan.read()
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 173, in read
return remote_do('scan_read', self._scanner_name)
File "/usr/local/lib/python3.5/dist-packages/pyinsane2/sane/abstract_proc.py", line 70, in remote_do
assert(len(result) == length)
AssertionError
from pyinsane.
MemoryError
How much free memory does your device has ? It seems it's running out of memory.
Unfortunately, Pyinsane uses quite a lot of memory to store the chunk of the images. In another bug report, someone reported having issues scanning at 600dpi with only 1GB of ram (raspberry pi).
from pyinsane.
I am using a pi, but I have a swap file that adds a GB so 2 in total. I am only scanning at 150 dpi so it should not be to much of a hog at that level. Was the error replicated on your machine with the script I attached in the previous comment?
from pyinsane.
Related Issues (20)
- Segfault when running tests HOT 7
- Mac OS X error pyinsane.get_devices() HOT 1
- Won't compile on Windows 8.1 (32 bits) Python 3.5.2 HOT 15
- Twain support HOT 4
- Assertion error getting/setting scanner options HOT 6
- Pyinsane doesn't complete scanning HOT 24
- Examples/ scan.py HOT 3
- Can't install pyinsane2 HOT 10
- Kyocera scanner - ECOSYS M2535dn HOT 2
- Getting a very long image in windows HOT 7
- Error while scanning. No paper to scan. [Epson DS-1660W Windows 10 driver] HOT 1
- Works only with sudo HOT 15
- No Module named pyinsane2 HOT 11
- WIADevMgr -> CreateDevice() failed HOT 18
- How to change the saving location of scanned document? HOT 6
- Epson DS-310 HOT 15
- Brother DCP-130C fails to scan HOT 7
- Cannot contribute with IronScanner HOT 2
- Fujitsu fi-7160 not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyinsane.