Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3950

Damaged images are loaded in Qt without any error

    XMLWordPrintable

Details

    Description

      Damaged JPEG image are loaded without error. It is not possible to know if an image has been correcly loaded. The only error is the following message in the console:
      "Corrupt JPEG data: premature end of data segment".

      To reproduce the problem, load the attached image with the following code:
      include <QtGui>

      int main(int argc, char **argv){
      QApplication app(argc, argv);
      QImage image;
      qDebug() << image.load("image.jpg");

      QImageReader imageReader("image.jpg");
      QImage image2 = imageReader.read();
      qDebug() << imageReader.errorString();
      return 0;
      }

      It would be nice to have a way to specify if the QImageIOHandler should fail or not when the data is corrupted.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              poulain Benjamin Poulain (closed Nokia identity) (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes