Facing an issue when trying to open an image file in a system viewer #271
Labels
Priority: Low
Doesn't require immediate attention
Type: Bug
Something isn't working as intended
Type: Installation
Installing, building, and/or launching the program
I am encountering an error when trying to open an image file by clicking on the image preview on the right-hand side of the UI.
I suppose this is not strictly relevant as trying to open the image using the "Open file" context menu option also causes the same issue
Further details
The output of
uname -a
:Linux yevhenii-80nv 6.6.31-1-lts #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 11:49:30 +0000 x86_64 GNU/Linux
I am running TagStudio with the following command:
python ./tagstudio/tag_studio.py --ui qt
(I have the virtual environment setup, the suggested dependencies specified inrequirements.txt
andrequirements-dev.txt
are installed, and the environment is activated)Here are some relevant logs:
The solution that worked for me
Running
pip uninstall opencv-python
andpip install opencv-python-headless
seems to resolve the issue.As far as I understand the issue in the first place is caused by
opencv-python
providing thelibqxcb.so
shared object, due to it supporting GUI preview built with Qt, that somehow conflicts with my image viewer (it's qimgv, which is also build using Qt) and causes it to produce the aforementioned error about not being able to load the Qt plugin. After theopencv-python
package is replaced withopencv-python-headless
qimgv most likely uses the systemlibqxcb.so
located at/usr/lib/qt/plugins/platforms/libqxcb.so
and I am able to open the image file from the TagStudio GUI without any issues.My suggestion would be to replace the
opencv-python
package withopencv-python-headless
, as no GUI preview funtionality provided byopencv-python
seems to be used and I suppose won't be used in the future.I am not certain whether this issue will persist outside the development enviroment, due to this being presumably caused by the inner workings of the virtual environments, but I still consider this an issue worth mentioning.
Addressing other solution mentioned on the internet that wasn't the case for me
The
libqxcb.so
shared object's dependenciesI have tried looking up the issue and many people suggest that the issue was related to the
libqxcb.so
shared object and its possibly missing dependencies. Here the object is located at/mnt/data/code/Python/Other/TagStudio/.venv/lib/python3.12/site-packages/cv2/qt/plugins/platforms/libqxcb.so
.I tried running
ldd /mnt/data/code/Python/Other/TagStudio/.venv/lib/python3.12/site-packages/cv2/qt/plugins/platforms/libqxcb.so
as suggested. Here is the output:As you can see, there are no missing dependencies, so this doesn't seem to be causing the issue.
The text was updated successfully, but these errors were encountered: