Fix trying to scale images on null images

This commit is contained in:
Luis Ángel San Martín 2020-09-03 18:00:29 +02:00
parent 4234dedece
commit 802e0d32ce

View File

@ -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;
}