openpaperwork / paperwork

Personal document manager (Linux/Windows) -- Moved to Gnome's Gitlab
https://gitlab.gnome.org/World/OpenPaperwork/paperwork
2.43k stars 148 forks source link

Scan fails when OCR is de-activated #251

Closed kriek closed 11 years ago

kriek commented 11 years ago

Hi, I'm using the stable branch of paperwork. When I try to scan a document with the OCR de-activated (as suggested for mass scanning in the wiki), the scan fails. I do not experience that issue if the OCR is activated.

Here is the log:

No handlers could be found for logger "pycountry.db"
INFO   paperwork.paperwork            Looking for locales in 'locale/fr/LC_MESSAGES/paperwork.mo' ...
INFO   paperwork.paperwork            Looking for locales in '/usr/local/share/locale/fr/LC_MESSAGES/paperwork.mo' ...
INFO   paperwork.paperwork            Looking for locales in '/usr/share/locale/fr/LC_MESSAGES/paperwork.mo' ...
INFO   root                           Will use locales from '/usr/share/locale'
INFO   paperwork.backend.config       Config file found: /home/sly/.config/paperwork.conf
INFO   root                           UI file used: /usr/share/paperwork/mainwindow.glade

(paperwork:2524): Gtk-WARNING **: Could not load image 'paperwork.svg': Impossible d'ouvrir le fichier « /usr/share/paperwork/paperwork.svg » : Aucun fichier ou dossier de ce type
INFO   paperwork.frontend.mainwindow  Image view port resized. (0, 0) --> (579, 709)
INFO   paperwork.frontend.jobs        [Scheduler Progress] Starting
INFO   paperwork.frontend.jobs        [Scheduler Main] Starting
INFO   paperwork.frontend.jobs        [Scheduler Progress] Started
INFO   paperwork.frontend.actions     Action: [Refresh index]
INFO   paperwork.frontend.jobs        [Scheduler Main] Started
INFO   paperwork.backend.docsearch    Opening index dir '/home/sly/.local/share/paperwork/index' ...
INFO   paperwork.frontend.mainwindow  Image view port resized. (579, 709) --> (514, 685)
INFO   paperwork.frontend.mainwindow  Document examen finished. Updating index ...
INFO   paperwork.frontend.mainwindow  New document: 0
INFO   paperwork.frontend.mainwindow  Updated document: 0
INFO   paperwork.frontend.mainwindow  Deleted document: 0
INFO   paperwork.frontend.mainwindow  No changes
INFO   paperwork.frontend.mainwindow  List 'documents' : 26 elements displayed (26 additionnal)
INFO   paperwork.frontend.actions     Action: [Scan a single page]
INFO   paperwork.backend.config       Scanner mode set to 'Color'
ERROR  paperwork.frontend.mainwindow  Warning: Unable to set scanner source: ['Auto', 'FlatBed', '.*ADF.*', '.*Feeder.*'] are not a valid values for option source
WARNING paperwork.frontend.mainwindow  Failed to read the resolution set on the scanner: <class 'pyinsane.rawapi.SaneStatus'> : Device is busy. Try again later (3). Assuming 300
ERROR  paperwork.frontend.jobs        ===> Job SingleScan:0 raised an exception: <type 'exceptions.TypeError'>: 'NoneType' object has no attribute '__getitem__'
ERROR  paperwork.frontend.jobs         0: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/jobs.py: L  158: _run
ERROR  paperwork.frontend.jobs         1: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/mainwindow.py: L 1216: do
ERROR  paperwork.frontend.jobs         2: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/backend/config.py: L  226: __get_langs
ERROR  paperwork.frontend.jobs         3: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/backend/config.py: L  206: __get_spelling_lang
ERROR  paperwork.frontend.jobs        ---> Job SingleScan:0 was started by:
ERROR  paperwork.frontend.mainwindow  Error while scanning: <type 'str'>: 'NoneType' object has no attribute '__getitem__'
ERROR  paperwork.frontend.jobs         0: /usr/local/bin/paperwork: L    5: <module>
ERROR  paperwork.frontend.jobs         1: /usr/lib/python2.7/dist-packages/pkg_resources.py: L  499: run_script
ERROR  paperwork.frontend.jobs         2: /usr/lib/python2.7/dist-packages/pkg_resources.py: L 1235: run_script
ERROR  paperwork.frontend.jobs         3: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/EGG-INFO/scripts/paperwork: L    6: <module>
ERROR  paperwork.frontend.jobs         4: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/paperwork.py: L   98: main
ERROR  paperwork.frontend.jobs         5: /usr/lib/python2.7/dist-packages/gi/types.py: L   43: function
ERROR  paperwork.frontend.jobs         6: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/actions.py: L   56: on_button_clicked_cb
ERROR  paperwork.frontend.jobs         7: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/actions.py: L   53: __do
ERROR  paperwork.frontend.jobs         8: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/mainwindow.py: L 1815: do
ERROR  paperwork.frontend.jobs         9: /usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/jobs.py: L  227: schedule
WARNING paperwork.frontend.jobs        Job SingleScan:0 took 10840ms and is unstoppable ! (maximum allowed: 500ms)
INFO   paperwork.frontend.mainwindow  List 'pages' : 0 elements displayed (0 additionnal)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/mainwindow.py", line 3506, in on_single_scan_error
    self.refresh_docs({self.doc})
  File "/usr/local/lib/python2.7/dist-packages/paperwork-0.1-py2.7.egg/paperwork/frontend/mainwindow.py", line 3717, in refresh_docs
    idx = doc_list.index(doc)
ValueError: <paperwork.backend.img.doc.ImgDoc object at 0x996398c> is not in list
jflesch commented 11 years ago

I will try it tomorrow.

In the meantime, just so you know, your Paperwork not up-to-date. The lastest stable version is 0.1.1, but in the stacktrace, you have "(...)/paperwork-0.1-py2.7.egg/(...). (also the lines in the stacktrace don't match the 0.1.1).

You can try

sudo pip uninstall paperwork

(you may have to run it many times) and then reinstall Paperwork.

kriek commented 11 years ago

You are right. I gave it an update and now I do not have that error anymore.