diff --git a/tools/auto-tester/src/ImageComparer.cpp b/tools/auto-tester/src/ImageComparer.cpp index 3afdeaec0a..56da37f225 100644 --- a/tools/auto-tester/src/ImageComparer.cpp +++ b/tools/auto-tester/src/ImageComparer.cpp @@ -17,9 +17,6 @@ double ImageComparer::compareImages(QImage resultImage, QImage expectedImage) const { // Make sure the image is 8 bits per colour QImage::Format format = expectedImage.format(); - if (format != QImage::Format::Format_ARGB32) { - throw -1; - } const int L = 255; // (2^number of bits per pixel) - 1 const double K1 { 0.01 }; diff --git a/tools/auto-tester/src/Test.cpp b/tools/auto-tester/src/Test.cpp index 1cfc32e481..7a61782f9e 100644 --- a/tools/auto-tester/src/Test.cpp +++ b/tools/auto-tester/src/Test.cpp @@ -81,12 +81,7 @@ bool Test::compareImageLists(bool isInteractiveMode, QProgressBar* progressBar) QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), "Images are not the same size"); similarityIndex = -100.0; } else { - try { - similarityIndex = imageComparer.compareImages(resultImage, expectedImage); - } catch (...) { - QMessageBox::critical(0, "Internal error: " + QString(__FILE__) + ":" + QString::number(__LINE__), "Image not in expected format"); - exit(-1); - } + similarityIndex = imageComparer.compareImages(resultImage, expectedImage); } if (similarityIndex < THRESHOLD) { diff --git a/tools/auto-tester/src/ui/AutoTester.cpp b/tools/auto-tester/src/ui/AutoTester.cpp index d94916ecbc..a238e2e7e8 100644 --- a/tools/auto-tester/src/ui/AutoTester.cpp +++ b/tools/auto-tester/src/ui/AutoTester.cpp @@ -127,14 +127,12 @@ void AutoTester::downloadImages(const QStringList& URLs, const QString& director } void AutoTester::saveImage(int index) { - QPixmap pixmap; - pixmap.loadFromData(downloaders[index]->downloadedData()); - - QImage image = pixmap.toImage(); - image = image.convertToFormat(QImage::Format_ARGB32); - - QString fullPathname = _directoryName + "/" + _filenames[index]; - if (!image.save(fullPathname, 0, 100)) { + try { + QFile file(_directoryName + "/" + _filenames[index]); + file.open(QIODevice::WriteOnly); + file.write(downloaders[index]->downloadedData()); + file.close(); + } catch (...) { QMessageBox::information(0, "Test Aborted", "Failed to save image: " + _filenames[index]); ui.progressBar->setVisible(false); return;