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

QPixmap alpha channel distortion when saving and loading as QDataStream

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.3.0
    • 4.7.0, 5.2.1
    • Image formats
    • None
    • Debian Jessie
    • 0226795cf33363a872c777034e0d8934ffaa3819

    Description

      When I save QPixmap as a stream to some file and then loads it from the file, alpha channel distorts. It is especially visible when image has a regions with variable alpha channel values.

      Next steps must be taken to reproduce a problem:
      1. load some image with alpha channel to QPixmap;
      2. save it as a stream to some file;
      3. load it from a file stream to QPixmap object;
      4. repeat steps 2-3 one to thousand times;
      5. save latest QPixmap as image again;
      6. compare initial and resulted images, specificially alpha channel.

      Relevant code looks like this: http://pastebin.com/MZKWMeA9
      I also created a github repo to run example faster, it has image example in README: https://github.com/JIghtuse/qt-image-bug
      Another image examples attached to this report (logo0.png - original image, logo1000.png - image after 1000 iterations of load/store as a stream, logo_diff.png - diff image generated by ImageMagic's compare tool).

      Attachments

        1. logo0.png
          logo0.png
          5 kB
        2. logo1000.png
          logo1000.png
          3 kB
        3. logo_diff.png
          logo_diff.png
          0.4 kB

        Activity

          People

            vgt Eirik Aavitsland
            jightuse Boris Egorov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: