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

QImage.convertToFormat fails to convert from RGB888 to Mono

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.9.2
    • 5.7.1
    • None
    • I use Qt5.7.1 on 64-bit Fedora Linux.

      The method QImage::convertToFormat() fails to convert an image from RGB888 to Mono. The following code returns a Null image.

      // image is a QImage in format RGB888QVector<QRgb> colors(2);
      image.convertToFormat(QImage::Format_Mono, colors)T

      The conversion does work as expected if I do not specify a color vector. Also, the conversion does work as expected if the image is in format RGB32 rather than RGB888. I attach a minimal test case

        1. testcase.tbz
          490 kB
          Stefan Kebekus
        For Gerrit Dashboard: QTBUG-63163
        # Subject Branch Project Status CR V

            allan.jensen Allan Sandfeld Jensen
            skebekus Stefan Kebekus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes