Describe the bug
After updating from version 3.7.1 to 3.7.6, I was unable to start the application. Immediately on startup an exception is thrown:
Traceback (most recent call last):
File "/usr/bin/fotokilof", line 33, in <module>
sys.exit(load_entry_point('FotoKilof==3.7.6', 'gui_scripts', 'fotokilof')())
File "/usr/bin/fotokilof", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3.9/site-packages/src/__main__.py", line 2246, in <module>
crop_tool_hide_show()
File "/usr/lib/python3.9/site-packages/src/__main__.py", line 1368, in crop_tool_hide_show
preview_orig()
File "/usr/lib/python3.9/site-packages/src/__main__.py", line 1197, in preview_orig
preview_picture = preview.preview_pillow(file_in_path.get(),
File "/usr/lib/python3.9/site-packages/src/preview.py", line 131, in preview_pillow
image_resized = image.resize((width_resize, height_resize))
UnboundLocalError: local variable 'image' referenced before assignment
Describe the bug After updating from version 3.7.1 to 3.7.6, I was unable to start the application. Immediately on startup an exception is thrown:
The last known (non-existing) image is opened here, causing an exception, causing the
image
variable to be unassigned. https://github.com/TeaM-TL/FotoKilof/blob/f23bf8a3064c40e49fb15803ea3a616fa7e6485a/src/preview.py#L112Further on,
image
is referenced, causing a crash: https://github.com/TeaM-TL/FotoKilof/blob/f23bf8a3064c40e49fb15803ea3a616fa7e6485a/src/preview.py#L131To Reproduce Steps to reproduce the behavior:
Expected behavior The application should startup independent of the previously opened file existing or not.