Simplify image conversion

This commit is contained in:
Anton Thomasson 2020-06-08 18:24:40 +02:00
parent 54f15dc372
commit 4f9ee8cb3c

View file

@ -311,16 +311,11 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem
if(imageFormat != "") if(imageFormat != "")
{ // We are converting to a supported image format { // We are converting to a supported image format
QTemporaryFile tmpImage;
tmpImage.open();
qDebug() << "Raw image: " << tmpImage.fileName();
outImage.save(tmpImage.fileName(), imageFormat.toStdString().c_str());
QFile tempfileAsFile(tempfile->fileName()); QFile tempfileAsFile(tempfile->fileName());
tempfileAsFile.open(QIODevice::Append); tempfileAsFile.open(QIODevice::Append);
tempfileAsFile.write(tmpImage.readAll()); outImage.save(&tempfileAsFile, imageFormat.toStdString().c_str());
tempfileAsFile.close(); tempfileAsFile.close();
tmpImage.close();
} }
else else
{ // We are converting to a raster format { // We are converting to a raster format