mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-03 09:21:31 -07:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user