Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

TWAIN backend does not allow to set DPI #15

Open
GoogleCodeExporter opened this issue Dec 18, 2015 · 0 comments
Open

TWAIN backend does not allow to set DPI #15

GoogleCodeExporter opened this issue Dec 18, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Retrieve Scanner object 
2. Attempt to call scan() method with dpi not set to 200

What is the expected output? What do you see instead?
Expected: scanning the document with desired DPI.
Actual: scanning the document with DPI 200.

What version of the product are you using? On what operating system?
imagescanner 0.9 for python 2.7 on win 7, installed via pip.


Suggested fix:
imagescanner/ backends/ twain/ __init__.py
@lines 53-54
    def _open(self):
        self._src_manager = twain.SourceManager(0)
        self._scanner = self._src_manager.OpenSource(self._source_name)
-       self._scanner.SetCapability(twain.ICAP_YRESOLUTION,
-                                   twain.TWTY_FIX32, 200.0)

@lines 60-61
    def scan(self, dpi=200):
        self._open()
+       self._scanner.SetCapability(twain.ICAP_YRESOLUTION, 
+                                   twain.TWTY_FIX32, dpi)
        self._scanner.RequestAcquire(0, 0)

Original issue reported on code.google.com by [email protected] on 22 May 2014 at 10:01

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

No branches or pull requests

1 participant