Scanner config location

I think my scanning database got corrupted (I suspect when pressing the recalibrate button in settings, the app crashed once)
when trying to scan or recalibrate my scanner (Brother ADS-1700W) Paperwork only crashes.
The logfiles seem to indicate libinsane crashing in background

Where are the configurations for the scanners located and will they simply be restored when deleted?

Backtrace when trying to calibrate (scanner scans the document, then paperwork fails, when loading the scan in claibration menu):

[WARNING] [openpaperwork_core.promise    ] === caught exception in promise ===
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/openpaperwork_core/promise.py", line 235, in _threaded_do
    our_r = self.func(*args, **self.kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/paperwork_gtk/settings/scanner/calibration.py", line 277, in _scan
    for (idx, img) in enumerate(img_generator):
  File "/usr/lib/python3.11/site-packages/paperwork_backend/docscan/libinsane.py", line 306, in _scan
    img = raw_to_img(scan_params, image.get_image())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/paperwork_backend/docscan/libinsane.py", line 79, in raw_to_img
    return PIL.Image.frombuffer(mode, (w, h), img_bytes, "raw", mode, 0, 1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/PIL/Image.py", line 3027, in frombuffer
    return frombytes(mode, size, data, decoder_name, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/PIL/Image.py", line 2969, in frombytes
    im.frombytes(data, decoder_name, args)
  File "/usr/lib64/python3.11/site-packages/PIL/Image.py", line 825, in frombytes
    d.setimage(self.im)
ValueError: tile cannot extend outside image

Backtrace when trying to scan (scanner scans, documents starts to apperar as a new document, then Paperwork displays an Error box, but the scan document shortly appears and then stays blank):

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/openpaperwork_gtk/mainloop/glib.py", line 160, in decorator
    func(*args, **kwargs)
  File "/usr/lib/python3.11/site-packages/openpaperwork_core/work_queue/default.py", line 30, in _on_error
    raise exc
  File "/usr/lib/python3.11/site-packages/openpaperwork_core/promise.py", line 235, in _threaded_do
    our_r = self.func(*args, **self.kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/openpaperwork_core/pillow/img.py", line 58, in url_to_img_size
    with self.core.call_success("fs_open", file_url, mode='rb') as fd:
TypeError: 'NoneType' object does not support the context manager protocol

After three error boxes (1 with the same as the first backtrace, then 2 the same as the second backtrace) the loading symbol says Loading Page 1/2…, but never finishes

Before trying to calibrate the scaner already worked, but had too long pages

Hello,

I’m not sure yet what’s going on in your stacktrace. At first sight, it looks like the scanner sent less data than expected (note to myself: also see bug report 610).

The scanner calibration is stored in the configuration file, and the configuration file is ~/.config/paperwork2.conf. Deleting this file is quite safe. If you delete it, you will just have to change Paperwork’s settings again (work directory, OCR language, etc) and run another scanner calibration.

Best regards

Hello,

thank you for your reply.
The config did not contain any scanner calibration data.
Therefore deleting it did not change this behaviour.

running paperwork-gtk config show yielded the following options (workdir and uuid not included):

bug_report_protocol = https
bug_report_server = openpaper.work
check_for_update = False
label_guessing_batch_size = 200
label_guessing_max_doc_backlog = 100
label_guessing_max_time = 10
label_guessing_max_words = 15000
label_guessing_min_features = 10
last_update_found = 2.1.2
log_files = stderr
log_format = [%(levelname)-6s] [%(name)-30s] %(message)s
log_level = warning
main_window_size = [2560, 1408]
ocr_langs = ['deu']
pageadd_active_source = feeder(left aligned)
pageadd_sources = ['feeder(left aligned)', 'feeder(center aligned)', 'feeder(left aligned,Duplex)', 'feeder(center aligned,Duplex)', 'Card Slot', 'Card Slot(Duplex)']
scanner_calibration = None
scanner_dev_id = libinsane:sane:brother5:net1;dev0
scanner_mode = Color
scanner_resolution = 300
scanner_source_id = None
send_statistics = False
settings_scanner_name = Brother ads1700w-hs
statistics_last_run = 1970-01-01
statistics_protocol = https
statistics_server = openpaper.work
sync_on_start = True
update_last_run = 1970-01-01
update_protocol = https
update_server = openpaper.work

Changing the scanner resolutionor colour to grayscale also resulted in the same error.
The scanner driver was installed directly from the manufacturer (link to driver on product site) and works with other scanning software (for example gnome simple-scan).
So maybe the problem comes from a wrong default value somewhere?

Kind regards

Update:
on a new PC the scanner works using

[scanner]
dev_id = str:libinsane:sane:airscan:w1:Brother ADS-1700W [XXXXXXXXXXXX]
calibration = list:float:31.557904411764703;int:0;int:2534;int:3496

[settings_scanner]
name = str:WSD Brother ADS-1700W [XXXXXXXXXXXX]

(mac adress crossed out)
Using the scanner provided by the brscan5 driver still causes the same problem as above

Can you try again and submit another bug report with the latest appimage build please ? It will still fails, but it’s expected: I’ve added some traces to help me understand this bug.

Using integrated bug report did not work dut to SSL errors
Bug report in gitlab is created wit log and report from scanning.
When calibrating report creation did not work because report buttons did not work (whole program frozen/crashed)