mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Fix trying to scale images on null images
This commit is contained in:
parent
4234dedece
commit
802e0d32ce
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user