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

QImage::scaled does not keep format from original to scaled image

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.0
    • 5.15
    • None
    • Ubuntu 20.04 LTS, Qt 5.15.2, gcc 9.4.0
    • Linux/X11

    Description

      void MainWindow::testQImageScaled(){
          QImage img (50, 50, QImage::Format_ARGB32);
          Q_ASSERT (img.format() == QImage::Format_ARGB32);
          img.fill(Qt::red);
          Q_ASSERT (img.format() == QImage::Format_ARGB32);
          QImage imgScaled = img.scaled(100, 100, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
          Q_ASSERT (img.format() == QImage::Format_ARGB32);
          if (imgScaled.format() == QImage::Format_ARGB32_Premultiplied)
              qDebug()<<"Format was implicitly changed from ARGB32 to ARGB32_Premultiplied with no notes in documentation about this.";
          Q_ASSERT (imgScaled.format() == QImage::Format_ARGB32);
      }

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            sacha_d Александр Думановский
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes