PDA

View Full Version : Open tga file



SteveQt
10th June 2015, 11:42
I want to open tga images in my application but apparently, it's not possible by default in Qt and a tierce party plugin must be used.
But I found in Qt files on Mac OS, in plugins/imageformats, the file libqtga.dylib. So I wondered if I can link this file in my project to read tga, and how (I didn't find any include files so I don't think it's possible) ?

Thanks

d_stranz
10th June 2015, 16:56
TGA support is standard in Qt. There are no header files - you simply use the ones for QImage or whatever, and specify TGA format where needed. When you distribute your app, you must be sure to install the dynamic library in the correct location, and specified in the Qt deployment guide. Search the docs for Qt for OS X - Deployment.

SteveQt
12th June 2015, 11:03
OK thanks for your answer, I searched in Qt doc and indeed tga is supported by default (I should have read that instead of answers on another forum :) ).
After trying to make it work without success, I read that in Qt doc : "TGA support only extends to reading non-RLE compressed files.". So I tested with a valid tga file and it's ok.

Thanks again!