diff options
Diffstat (limited to 'src/gui/image/qppmhandler.cpp')
-rw-r--r-- | src/gui/image/qppmhandler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/gui/image/qppmhandler.cpp b/src/gui/image/qppmhandler.cpp index 16136e6be3..afeb403abb 100644 --- a/src/gui/image/qppmhandler.cpp +++ b/src/gui/image/qppmhandler.cpp @@ -160,11 +160,8 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q } raw = type >= '4'; - if (outImage->size() != QSize(w, h) || outImage->format() != format) { - *outImage = QImage(w, h, format); - if (outImage->isNull()) - return false; - } + if (!QImageIOHandler::allocateImage(QSize(w, h), format, outImage)) + return false; pbm_bpl = (qsizetype(w) * nbits + 7) / 8; // bytes per scanline in PBM |