Fix QFile::open complaining the device was already open in

TextureBaker::processTexture
This commit is contained in:
sabrina-shanman 2019-03-14 13:29:56 -07:00
parent 5e430c98c5
commit 3016860bab

View file

@ -205,7 +205,11 @@ QImage processRawImageData(QIODevice& content, const std::string& filename) {
// Help the QImage loader by extracting the image file format from the url filename ext.
// Some tga are not created properly without it.
auto filenameExtension = filename.substr(filename.find_last_of('.') + 1);
content.open(QIODevice::ReadOnly);
if (!content.isReadable()) {
content.open(QIODevice::ReadOnly);
} else {
content.reset();
}
if (filenameExtension == "tga") {
QImage image = image::readTGA(content);