From 04ffa663671011757a71d18b8724002c052ca551 Mon Sep 17 00:00:00 2001 From: Lauri Laanmets Date: Mon, 21 Mar 2016 16:13:42 +0200 Subject: [PATCH] Disable saving image files by default and correct wrong scope for returned image. --- src/qzxing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qzxing.cpp b/src/qzxing.cpp index 1f0c262..15cbfcb 100644 --- a/src/qzxing.cpp +++ b/src/qzxing.cpp @@ -303,7 +303,7 @@ QImage QZXing::encodeData(const QString& data) Ref barcode = qrcode::Encoder::encode(data, qrcode::ErrorCorrectionLevel::L ); Ref bytesRef = barcode->getMatrix(); const std::vector< std::vector >& bytes = bytesRef->getArray(); - QImage image(bytesRef->getWidth(), bytesRef->getHeight(), QImage::Format_ARGB32); + image = QImage(bytesRef->getWidth(), bytesRef->getHeight(), QImage::Format_ARGB32); for(int i=0; igetWidth(); i++) for(int j=0; jgetHeight(); j++) image.setPixel(i, j, bytes[i][j] ? @@ -311,7 +311,7 @@ QImage QZXing::encodeData(const QString& data) qRgb(255,255,255)); image = image.scaled(240, 240); - bool success = image.save("tmp.bmp","BMP"); + //bool success = image.save("tmp.bmp","BMP"); } catch (std::exception& e) { std::cout << "Error: " << e.what() << std::endl; }