Created attachment 150646 [details] gwenview's log, while it's attempting to open a tga file SUMMARY gwenview is unable to open any .tga files (tried exporting a .tga file in GIMP, to make sure that image is 100% valid, but it doesn't open them as well). STEPS TO REPRODUCE 1. Open any .tga image 2. Observe the error OBSERVED RESULT gwenview shows an error message "Loading 'something.tga' failed, Loading meta information" EXPECTED RESULT gwenview displays an image SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.18.11-arch-1 (64-bit) (available in About System) KDE Plasma Version: 5.25.3 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5 ADDITIONAL INFORMATION I attached gwenview's log in the attachments
I'm seeing this as well on gwenview-24.02.0 with KF6 6.0.0.
For reference, the TGA files work in Kolourpaint, but not Okular. (Okular says it's unable to read image data.)
org.kde.kdegraphics.gwenview.lib: QImageReader::read() using format hint "tga" failed: "Unknown error" org.kde.kdegraphics.gwenview.lib: A bad Qt image decoder moved the buffer to 18 in a call to canRead()! Rewinding. org.kde.kdegraphics.gwenview.lib: Image format is actually "ico" not "tga" It seems to be an issue with the underlying QImageReader not handling TGA properly. *** Fixed it, it seems to be an issue with qtimageformats. My system has two TGA Qt image plugins installed: libqtga (part of qtimageformats), and kimg_tga (part of kimageformats). With both enabled, gwenview tries using libqtga first, which fails. Disabling libqtga causes gwenview to use kimg_tga instead, and that appears to work, at least for true-color TGAs. (8-bpp TGAs aren't loading for me with either one.)
*** Bug 488314 has been marked as a duplicate of this bug. ***
> My system has two TGA Qt image plugins installed: libqtga (part of qtimageformats), and kimg_tga (part of kimageformats). With both enabled, gwenview tries using libqtga first, which fails. I did some research and it's documented in the QImageIOPlugin Detailed Description: "Different plugins can support different capabilities. For example, you may have one plugin that supports reading the GIF format, and another that supports writing. Qt will select the correct plugin for the job, depending on the return value of capabilities(). If several plugins support the same capability, Qt will select one arbitrarily." I added a warn in the README.md of MR 395 (https://invent.kde.org/frameworks/kimageformats/-/merge_requests/395). Since this is a Qt behavior, the only way is to "disable" the libqtga plugin (by renaming or deleting it). It's not a GwenView bug. I won't this issue anyway, because that would just open another one right away. :) > (8-bpp TGAs aren't loading for me with either one.) When MR 395 will be merged, you should be able to open all kind of TGA files.