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

QTransform results in distorted image for some images

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.0 Beta 3
    • 4.7.2, 5.3.0, 5.4.0, 5.9.0 Beta 1
    • None

    Description

      consider the following code:

      QImage image(...);
      QPixmap pix = QPixmap::fromImage( image.transformed(QTransform().rotate(45) ,Qt::SmoothTransformation) );
      pix.save(...);
      

      This code results in a 45° rotated image for all images (attached), except for "test_800x600_8bit.png". Which results in a completely distorted image:

      So it seems it fails for some images. But i only encountered it for some 8bit PNG files, which are bigger than a certain size, since it works for small 8bit PNG images.

      Attachments

        1. PixmapRotation.tar.gz
          1 kB
        2. test_32bit.png
          test_32bit.png
          1 kB
        3. test_800x600_32bit.png
          test_800x600_32bit.png
          12 kB
        4. test_800x600_8bit_rotated.png
          test_800x600_8bit_rotated.png
          5 kB
        5. test_800x600_8bit.png
          test_800x600_8bit.png
          10 kB
        6. test_8bit.png
          test_8bit.png
          1 kB

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            raven-worx raven-worx
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: