mteillet / PyVexr

Python open Exr Viewer
MIT License
5 stars 0 forks source link

Crash when giving an non-existing OCIO config path #3

Closed MrLixm closed 1 year ago

MrLixm commented 1 year ago

Hey there,

Issue

The application hard crash when I'm trying to enter a path to a config that doesn't exists.

F:\softwares\apps\pyvexr\0.0.3\dist>pyVexr_gui.exe
qt.qpa.fonts: Unable to enumerate family ' "Segoe UI Variable Static Display" '
qt.qpa.fonts: Unable to enumerate family ' "Segoe UI Variable Static Display" '
Traceback (most recent call last):
File "pyVexr_gui.py", line 1979, in onCsChanged
File "pyVexr_main.py", line 355, in getLooks
PyOpenColorIO.Exception: Error could not read 'ocio/config.oci' OCIO profile. 

Steps to reproduce

You can also just paste a non-existing path to get the same result

Expected behavior

The application doesn't crash and let the user submit a wrong path. I expect an error message to be displayed somewhere to tell me my path is wrong. And then I can correct it manually if it's a simple typo.


Cheers.

mteillet commented 1 year ago

Hello,

It is fixed in this commit, and will be part of the next release : https://github.com/mteillet/PyVexr/commit/ff4c318ab9665fb5767fdd7910657f458d897caf

Screenshot from 2022-12-14 08-40-31

The behaviour of the QLineEdit containing the path has also been modified. It now triggers the pathChanged function only when the users presses the enter on his keyboard, instead of whenever the field was modified. If the ocio path is wrong, the ocio variable used for backend will stay the same as the previous valid one (it will however keep the wrong path in the QLineEdit field, in order for the user to be able to simply fix a typo), and an error message will pop up.

This fix will be included in the next release :smile:

Thanks again for your feedback.

Martin