D8415: Soften correctness of image file open check

Julian Wolff noreply at phabricator.kde.org
Mon Oct 23 12:37:40 UTC 2017


progwolff added a comment.


  In https://phabricator.kde.org/D8415#158804, @aacid wrote:
  
  > Wouldn't it make more sense to fix this in QImageReader and not in every user of QImageReader ?
  
  
  From my perspective the behaviour of QImageReader is correct.
  
  QImage::read docs:
  
  > Reads an image from the device into image, which must point to a QImage. Returns true on success; otherwise, returns false.
  
  QImage::isNull docs:
  
  > Returns true if it is a null image, otherwise returns false.
  >  A null image has all parameters set to zero and no allocated data.
  
  It seems totally possible that an empty image file is read correctly. In this case read returns true, but the resulting image is a null image.
  
  For this patch I would however prefer a new error message, something like "the loaded document is empty".

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D8415

To: trufanov, ngraham, #okular
Cc: aacid, progwolff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20171023/bb391cfa/attachment.html>


More information about the Okular-devel mailing list