Scan-o-Matic / scanomatic-standalone

GNU General Public License v3.0
0 stars 0 forks source link

using default grayscale file if not found in config #150

Closed BengtRydberg closed 2 years ago

BengtRydberg commented 2 years ago

This PR allows for using a default grayscales.cfg file. Don't know if this is the best solution, but without this scanomatic reads the file from a directory that is mounted into the container and hence there is no guarantee this file is present.

Anyhow, I created a new fixture, compiled a project using this fixture, and made a quality control that look like this:

Screenshot from 2022-02-02 20-35-56

don't really know if it looks ok, but at least the processing didn't crash.

local-minimum commented 2 years ago

Running docker-compose up --build I got:

scanomatic_1  | Traceback (most recent call last):
scanomatic_1  |   File "/usr/local/lib/python3.9/shutil.py", line 265, in copyfile
scanomatic_1  |     with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
scanomatic_1  | IsADirectoryError: [Errno 21] Is a directory: '/tmp/data/config/ccc'
scanomatic_1  | 
scanomatic_1  | The above exception was the direct cause of the following exception:
scanomatic_1  | 
scanomatic_1  | Traceback (most recent call last):
scanomatic_1  |   File "/tmp/setup_config.py", line 21, in <module>
scanomatic_1  |     setup_config()
scanomatic_1  |   File "/tmp/setup_config.py", line 17, in setup_config
scanomatic_1  |     copyfile(source_path, destination_path)
scanomatic_1  |   File "/usr/local/lib/python3.9/shutil.py", line 293, in copyfile
scanomatic_1  |     raise FileNotFoundError(f'Directory does not exist: {dst}') from e
scanomatic_1  | FileNotFoundError: Directory does not exist: root/.scan-o-matic/config/ccc
scanomatic-standalone_scanomatic_1 exited with code 1

Probably missing some making of directories of the subdirectories.

BengtRydberg commented 2 years ago

I think the PR looks good (and should be merged as is), but I don't think it solves the validate fixture task because I simply cannot get any grayscale detection with the correct grayscale (silverfast) and the detection with the wrong one (kodak) looks funky

image

I have managed to get detection with silverfast, but I had to try a number of times to get it to work...

local-minimum commented 2 years ago

Can you screenshot how the curve of the detection looks?

BengtRydberg commented 2 years ago

Running docker-compose up --build I got:

scanomatic_1  | Traceback (most recent call last):
scanomatic_1  |   File "/usr/local/lib/python3.9/shutil.py", line 265, in copyfile
scanomatic_1  |     with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
scanomatic_1  | IsADirectoryError: [Errno 21] Is a directory: '/tmp/data/config/ccc'
scanomatic_1  | 
scanomatic_1  | The above exception was the direct cause of the following exception:
scanomatic_1  | 
scanomatic_1  | Traceback (most recent call last):
scanomatic_1  |   File "/tmp/setup_config.py", line 21, in <module>
scanomatic_1  |     setup_config()
scanomatic_1  |   File "/tmp/setup_config.py", line 17, in setup_config
scanomatic_1  |     copyfile(source_path, destination_path)
scanomatic_1  |   File "/usr/local/lib/python3.9/shutil.py", line 293, in copyfile
scanomatic_1  |     raise FileNotFoundError(f'Directory does not exist: {dst}') from e
scanomatic_1  | FileNotFoundError: Directory does not exist: root/.scan-o-matic/config/ccc
scanomatic-standalone_scanomatic_1 exited with code 1

Probably missing some making of directories of the subdirectories.

I changed the script so it only copies files.

Can you screenshot how the curve of the detection looks? Screenshot from 2022-02-04 10-37-21

local-minimum commented 2 years ago

Great that looks like a proper GS too. Lets say it resolves the thing then (you'll have to re-add it)