Closed jcjgraf closed 4 years ago
This is really weird, especially the issue when opening jpg files. I can reproduce the issue with opening cr2 files, but also have the same problem with other programs that use qt + qtraw. Difference here is that the cr2 files I had are recognized as cr2 just fine, not as tiff. This will need some further investigation, maybe something changed with a new qt version.
Concerning the jpg issue: does this happen for all jpg files or is this specific to this one? As mentioned, I was not able to reproduce this with any version of vimiv (master, 0.7.0).
By reverting python-pyqt5
to version 5.14.2-1
and qt5-base
to 5.14.2-2
I was again able to open jpgs (both, with the Aur version and the git version). I have also tried to revert libraw
to 0.19.5-2
but I was still not able to open cr2 images. Weirdly, after updating these packages back to the lastest version, I can still open jpgs with both version of vimiv.
This is really weird. Not sure what to do about the jpg part as I am not able to reproduce it. I will try to do some more testing, but this is not that high on my priority list as I have no clue where to start...
Concerning the cr2 images I will try to do some more debugging once I find the time, hopefully soon.
The jpg issue was probably cause by some dependency issue/conflict and as long as it is not happening again it is probably no worth spending too much time investigating it.
The cr2 issue is definitely more of a concern to me. I have tried to debug the problem, but without too much success. Here a short summary:
files.imghdr.what(myCr2)
return TIFF for all my images.QImageReader(pyCr2, ...).supportedImageFormats()
does not include cr2.--tempdir
to the dir containing that image. After switching to the parent dir and back, the image is listed in vimiv (seems to happen always to the same images).It would be great if you @karlch could have a look at the cr2 problem. I am willing to help but I am not sure how to debug this issue.
Very similar status here unfortunately. I can also not open any of the cr2 files I was previously able to. Only difference I have had is that I was able to get cr2
back into QImageReader.supportedImageFormats()
by (re-)installing qtraw-git
from the AUR
.
However if I then create a QImageReader(myCr2, b"cr2")
this still returns False
for canRead
thus leading to the same final result: not opening the cr2.
This whole chain can be checked without using vimiv, just by running:
from PyQt5.QtGui import QImageReader
assert b"cr2" in QImageReader.supportedImageFormats(), "No cr2 support in QImageReader"
reader = QImageReader("my.cr2", b"cr2")
print(reader.format())
print(reader.canRead())
Which gives
b'cr2'
False
for me.
I am unfortunately also somewhat stuck. Maybe I will try to reproduce in plain c++, probably waste of time, but then we could discuss the issue within qtraw directly. Maybe the author has some other ideas.
For me the assertion fails even though I have reinstalled qtraw-git
several times (as well as its dependencies).
Interesting is that for me imghdr
fails to detect cr2
as cr2
even though imghdr
works independently of qtraw
.
Weird, not sure what else to recommend to get it back in the supportedImageFormats
.
If you use the imghdr
module from within vimiv.utils.files
, this is not quite true. cr2
is not in the default checks of imghdr
so we add our own within the imageformats
plugin. A new test is only valid if the format is also in supportedImageFormats
, otherwise vimiv will not accept it. Therefore, if qtraw
does not add the cr2
format correctly, also the imghdr
module from vimiv.utils.files
will not accept it.
Thanks for the explanation, it all makes sense when I had a closer look at the source code!
Since this problem has not magically resolved itself and since I have no idea how to debug this problem, I have written a little plugin which add raw support via the embedded jpeg thumbnail in the raw file (see here).
Long story short, with the current git version I am no longer able to open cr2 images and with the vimiv-qt version available on Aur it does not even work for jpgs anymore. It used to work when I last used vimiv-qt a few weeks ago.
I presume that I have misconfigured something locally or that there is a dependency issue/conflict. Unfortunately, I was not able to resolve the issue by simply reinstalling vimiv an all its dependencies.
Maybe @karlch you have an idea what could cause this issue or at least can directly into the right direction.
uname -a
``` Linux jcarch 5.4.55-1-lts #1 SMP Fri, 31 Jul 2020 17:38:35 +0000 x86_64 GNU/Linux ```pacman -Qi vimiv-qt
``` Name : vimiv-qt Version : 0.7.0-1 Description : An image viewer with vim-like keybindings Architecture : any URL : https://github.com/karlch/vimiv-qt Licenses : GPL3 Groups : None Provides : vimiv Depends On : python-pyqt5 Optional Deps : qt5-svg: for svg support [installed] python-piexif: for exif support [installed] qt5-imageformats: for additional image formats [installed] Required By : None Optional For : None Conflicts With : vimiv vimiv-git vimiv-qt-git Replaces : None Installed Size : 1035.70 KiB Packager : Unknown Packager Build Date : Sun 23 Aug 2020 17:38:14 CEST Install Date : Sun 23 Aug 2020 17:38:38 CEST Install Reason : Explicitly installed Install Script : No Validated By : None ```pacman -Qi qt5-imageformats
``` Name : qt5-imageformats Version : 5.15.0-1 Description : Plugins for additional image formats: TIFF, MNG, TGA, WBMP Architecture : x86_64 URL : https://www.qt.io Licenses : GPL3 LGPL3 FDL custom Groups : qt qt5 Provides : None Depends On : qt5-base jasper libmng libwebp Optional Deps : None Required By : telegram-desktop Optional For : vimiv-qt Conflicts With : None Replaces : None Installed Size : 208.13 KiB Packager : Antonio Rojaspacman -Qi qtraw
``` Name : qtraw Version : 1.1-1 Description : Qt image plugin for loading raw files, via libraw Architecture : x86_64 URL : https://github.com/mardy/qtraw Licenses : GPL3 Groups : None Provides : None Depends On : qt5-base libraw Optional Deps : None Required By : None Optional For : None Conflicts With : None Replaces : None Installed Size : 34.06 KiB Packager : Unknown Packager Build Date : Mon 24 Aug 2020 17:34:41 CEST Install Date : Mon 24 Aug 2020 17:35:31 CEST Install Reason : Explicitly installed Install Script : No Validated By : None ```Debug Log of opening a jpg
``` [17:38:32] DEBUGDebug Log of opening a cr2
``` [17:40:25] DEBUGSomething I have noticed is that in the
_file_handler.py
line 99 thefile_format
isTIFF
instead ofcr2
for the Raw image. Hardcodingfile_format = "cr2"
did still not let me open the raw image. However, it would also not have explained why jpgs are not working (they are correctly detected as jpgs byimghdr
).If you need any other logs/information let me know. Since I am not sure that could cause this issue, I am not sure that information is best to provide you :grimacing: