Bug 456757 - gwenview doesn't open .tga files
Summary: gwenview doesn't open .tga files
Status: REPORTED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 22.04.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-15 13:30 UTC by Deniil
Modified: 2024-03-13 15:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
gwenview's log, while it's attempting to open a tga file (1.19 KB, text/x-log)
2022-07-15 13:30 UTC, Deniil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Deniil 2022-07-15 13:30:06 UTC
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
Comment 1 David Korth 2024-03-13 15:23:22 UTC
I'm seeing this as well on gwenview-24.02.0 with KF6 6.0.0.
Comment 2 David Korth 2024-03-13 15:38:52 UTC
For reference, the TGA files work in Kolourpaint, but not Okular. (Okular says it's unable to read image data.)
Comment 3 David Korth 2024-03-13 15:59:15 UTC
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.)