Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twain.ICAP_YRESOLUTION wrong return value #15

Open
chmuche opened this issue May 22, 2017 · 2 comments
Open

twain.ICAP_YRESOLUTION wrong return value #15

chmuche opened this issue May 22, 2017 · 2 comments

Comments

@chmuche
Copy link

chmuche commented May 22, 2017

Hello,
When i use this code the return value of scanner.GetCapability(twain.ICAP_YRESOLUTION)
return wrong value.

sourceManager = twain.SourceManager(0)
scanner = sourceManager.OpenSource('TW-Brother ADS-2400N')
dpi = scanner.GetCapability(twain.ICAP_YRESOLUTION)

result of print dpi
(7, (3, 3, [100.0, 0.384, 0.15, -27136.0, 150.0, 0.512, 0.2]))

I don't uderstand the value.
If I use a another software the value type is TWON_ENUMERATION

and the value are :

  • 100
  • 150
  • 200
  • 300
  • 400
  • 600
  • 1200
@chmuche chmuche changed the title twain.ICAP_YRESOLUTION weird return value twain.ICAP_YRESOLUTION wrong return value May 22, 2017
@denisenkom
Copy link
Owner

(7, (3, 3, [100.0, 0.384, 0.15, -27136.0, 150.0, 0.512, 0.2]))
here 7 means enumeration, it is equal to value of TWON_ENUMERATION
first 3 is current index, this is the index of current value
second 3 is default index, this is the index of default value
the array contains values for enumeration, but in your case they seems to be incorrectly converted, try using _fix2float to convert them to float.

@chmuche
Copy link
Author

chmuche commented Jun 6, 2017

Thanks, I give up to use YRESOLUTION. But I will try and tell you if _fix2float works.

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

No branches or pull requests

2 participants