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

QPrinter corrupts some images ((due to lossy JPG encoding) when writing to PDF

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.5.1
    • Fix Version/s: 5.13
    • Component/s: GUI: Printing
    • Labels:
      None
    • Platform/s:
      Linux/X11, macOS, Windows
    • Commits:
      9cd527bc1f384926985d63c741641316a66f17a4

      Description

      Qt uses lossy encoding when writing images to a PDF file. I believe it forces JPG encoding, even if this is grossly inappropriate. This can lead to bad distortion of images in the output file and artefacts.

      This can mostly easily be seen when writing low pixel count images to a PDF file.

      Please provide an option to disable the lossy JPEG output and use PNG/Zlib instead.

      Attached is an example which uses a simple 3x3 image showing large differences from the also-written PNG file.

        Attachments

        1. qtbug54809_print.pdf
          2 kB
        2. qtbug54809.zip
          2 kB
        3. screenshot.png
          screenshot.png
          88 kB
        4. test2.cpp
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            anrocha André De La Rocha
            Reporter:
            jeremysanders Jeremy Sanders
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes