mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 11:04:25 -04:00
Fix trying to scale images on null images
This commit is contained in:
@ -1388,7 +1388,10 @@ void YACReaderPageFlowGL::populate(int n)
|
|||||||
QImage ImageLoaderGL::loadImage(const QString &fileName)
|
QImage ImageLoaderGL::loadImage(const QString &fileName)
|
||||||
{
|
{
|
||||||
QImage image;
|
QImage image;
|
||||||
bool result = image.load(fileName);
|
|
||||||
|
if (!image.load(fileName)) {
|
||||||
|
return QImage();
|
||||||
|
}
|
||||||
|
|
||||||
switch (flow->performance) {
|
switch (flow->performance) {
|
||||||
case low:
|
case low:
|
||||||
@ -1404,9 +1407,6 @@ QImage ImageLoaderGL::loadImage(const QString &fileName)
|
|||||||
break; //no scaling in ultraHigh
|
break; //no scaling in ultraHigh
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result)
|
|
||||||
return QImage();
|
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1493,7 +1493,10 @@ QImage ImageLoaderGL::result()
|
|||||||
QImage ImageLoaderByteArrayGL::loadImage(const QByteArray &raw)
|
QImage ImageLoaderByteArrayGL::loadImage(const QByteArray &raw)
|
||||||
{
|
{
|
||||||
QImage image;
|
QImage image;
|
||||||
bool result = image.loadFromData(raw);
|
|
||||||
|
if (!image.loadFromData(raw)) {
|
||||||
|
return QImage();
|
||||||
|
}
|
||||||
|
|
||||||
switch (flow->performance) {
|
switch (flow->performance) {
|
||||||
case low:
|
case low:
|
||||||
@ -1510,9 +1513,6 @@ QImage ImageLoaderByteArrayGL::loadImage(const QByteArray &raw)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result)
|
|
||||||
return QImage();
|
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user