diff --git a/common/gl/yacreader_flow_gl.cpp b/common/gl/yacreader_flow_gl.cpp index 13a3bc58..ad59daf7 100644 --- a/common/gl/yacreader_flow_gl.cpp +++ b/common/gl/yacreader_flow_gl.cpp @@ -1388,7 +1388,10 @@ void YACReaderPageFlowGL::populate(int n) QImage ImageLoaderGL::loadImage(const QString &fileName) { QImage image; - bool result = image.load(fileName); + + if (!image.load(fileName)) { + return QImage(); + } switch (flow->performance) { case low: @@ -1404,9 +1407,6 @@ QImage ImageLoaderGL::loadImage(const QString &fileName) break; //no scaling in ultraHigh } - if (!result) - return QImage(); - return image; } @@ -1493,7 +1493,10 @@ QImage ImageLoaderGL::result() QImage ImageLoaderByteArrayGL::loadImage(const QByteArray &raw) { QImage image; - bool result = image.loadFromData(raw); + + if (!image.loadFromData(raw)) { + return QImage(); + } switch (flow->performance) { case low: @@ -1510,9 +1513,6 @@ QImage ImageLoaderByteArrayGL::loadImage(const QByteArray &raw) break; } - if (!result) - return QImage(); - return image; }