Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QImage and TGA support in c++
I need to open tga images with Qt in c++. I've read that it's already supported here: https://doc.qt.io/qt-5/qtimageformats-index.html
But loading with both QImage::load or directly with QImage("path/to/tga/file.tga") returns NULL.
Should i take extra steps to open tga files?
KillerSmath last edited by
I tested a Version using QImageReader but i got the same problem.
But when i readed the documentation.
TGA support only extends to reading non-RLE compressed files.
You can work around this problem with the solution of this thread:
Create a function to read TGA compressed files and return a QImage.
QImage loadTga(const char* filePath, bool &success)
Thanks a lot! I'll try right now
@KillerSmath It worked flawlessly! Thanks a lot. Now i also need to open dds images. I'll search a bit on where to find and how to compile the module.
@KillerSmath May be i got happy to soon.. that function only loads correctly for me 24 bit compressed tga.. but it fails with 32 bits (and does not support 16 bit). Also, i think it does not support transparency.