Import Page From Scanner is broken
There are at least 4 bugs.
Bug 1
Gtk.Box.pack_start()
takes exactly 5 non-keyword arguments.
It seems that the default arguments have been removed.
https://stackoverflow.com/a/17354844
Error
Traceback (most recent call last):
File "/app/lib/python2.7/site-packages/ocrfeeder/studio/studioBuilder.py", line 201, in __obtainScannersFinishedCb
devices)
File "/app/lib/python2.7/site-packages/ocrfeeder/studio/widgetPresenter.py", line 2039, in __init__
Gtk.STOCK_OK,
TypeError: Gtk.Box.pack_start() takes exactly 5 non-keyword arguments (2 given)
Patch
Bug 2
Unable to select any scanner in Scanner Chooser Dialog.
We should call getSelectedDevice()
before destroying ScannerChooserDialog
.
Error
Patch
Bug 3
Error
There is a bug in __scanFinishedCb()
.
We need to specify the parent window.
Error
Traceback (most recent call last):
File "/app/lib/python2.7/site-packages/ocrfeeder/studio/studioBuilder.py", line 239, in __scanFinishedCb
'warning')
File "/app/lib/python2.7/site-packages/ocrfeeder/studio/widgetPresenter.py", line 1180, in __init__
buttons = Gtk.ButtonsType.OK)
File "/app/lib/python2.7/site-packages/gi/overrides/__init__.py", line 319, in new_init
return super_init_func(self, **new_kwargs)
File "/app/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 575, in __init__
self._init(*args, **new_kwargs)
File "/app/lib/python2.7/site-packages/gi/overrides/__init__.py", line 319, in new_init
return super_init_func(self, **new_kwargs)
File "/app/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 521, in __init__
_window_init(self, *args, **kwargs)
File "/app/lib/python2.7/site-packages/gi/overrides/__init__.py", line 319, in new_init
return super_init_func(self, **new_kwargs)
TypeError: could not convert value for property `transient_for' from str to GtkWindow
Patch
Bug 4
Invalid scanner options lead to an unrecoverable error:
Error scanning page
Some scanners don't support the Resolution
parameter at all.
Supported modes may be vary across different scanners.
Not all of them support the "Color"
mode.
For example, some of them support "Color24"
or "Color48"
instead.
Error
Patch
Bug 5
Some scanner by default select only a small area (e.g. 0.0,0.0x103.0,76.2099914551
) instead of full page (e.g. 0.0,0.0x215.0,297.0
).
We want to fix it by trying to maximize the scan area, if possible. Not all devices are able to do this so we have to handle any exception.