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

QImage::scale doesn't work for Format_Grayscale16 images

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.2
    • Fix Version/s: 6.0.1, 6.1.0 Alpha
    • Component/s: GUI: Painting
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      ade24763c74ce506276218ec1ce0e307301717fe (qt/qtbase/dev) 978131ba7106df99e010f5ea5559204424f29ab7 (qt/qtbase/6.0) 625a0d57aff2c0f42c832eabcc123778e0374922 (qt/tqtc-qtbase/tqtc/lts-5.15)

      Description

      If you try to scale a QImage::Format_Grayscale16 image the generated image is wrong. I attach a 16 bit image to test.

      QImage roi;
      roi.load("roiImg.png");
      auto scaledRoi = roi.scaled(roi.width()/2, roi.height()/2, Qt::KeepAspectRatio);
      scaledRoi.save("roiImgScaled.png");
      
      

      This bug also affects QPainter::drawImage().

        Attachments

        1. roiImg.png
          roiImg.png
          2.31 MB
        2. roiScaled.png
          roiScaled.png
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            allan.jensen Allan Sandfeld Jensen
            Reporter:
            gghelli Gianluca Ghelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes