Support loading of files with wrong extension
Like M15’s .png that cockatrice wrongly saved as .jpg Additionally, move the QImageReader declaration outside of the inner loop
This commit is contained in:
parent
4bb1d28ae7
commit
6502a182e8
1 changed files with 3 additions and 2 deletions
|
@ -132,11 +132,12 @@ void PictureLoader::processLoadQueue()
|
|||
<< _picsPath + "/downloadedPics/" + ptl.getSetName() + "/" + ptl.getCard()->getCorrectedName() + ".full";
|
||||
|
||||
QImage image;
|
||||
QImageReader imgReader;
|
||||
imgReader.setDecideFormatFromContent(true);
|
||||
bool found = false;
|
||||
|
||||
|
||||
//Iterates through the list of paths, searching for images with the desired name with any QImageReader-supported extension
|
||||
for (int i = 0; i < picsPaths.length() && !found; i ++) {
|
||||
QImageReader imgReader;
|
||||
imgReader.setFileName(picsPaths.at(i));
|
||||
if (imgReader.read(&image)) {
|
||||
emit imageLoaded(ptl.getCard(), image);
|
||||
|
|
Loading…
Reference in a new issue