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

QImage and QImageWriter does not save PNG image

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.14.1
    • Image formats
    • None
    • Desktop_Qt_5_14_1_MSVC2015_64bit-Debug
      The project was created in Qt Creator 4.11.0
    • Windows

    Description

      The following code fails (It works with a different formats, for example TIF, and works with PNG in Qt 5.4.1):

       
      QImage image;
      ...
      image.load("test.png");
      image = image.convertToFormat(QImage::Format_ARGB32);//optional
      bool couldSave = image.save("test2.png"); //couldSave returns false
      Q_ASSERT(couldSave); //This fails
      ...
      // Or so
      QImageWriter writer("test2", "PNG");
      bool r = writer.write(image); //This fails
      qDebug()<< r;// r - false
      qDebug() << writer.errorString();//An unknown error occurred

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            olegs Oleg S
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes