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

QImageWriter for PNG: setting "quality" when you want compression does not make sense

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.4.0
    • Fix Version/s: None
    • Component/s: Image formats
    • Labels:
      None
    • Environment:
      All

      Description

      Turning on compression for a PNG has no impact on the quality of the image, only the file size.

      Using QImageWriter for PNG, setQuality() actually changes the compression on a PNG file when saving. setCompression() is not implemented so it is ignored. Not only that, but setQuality() plays around with things in the background, so setting quality to 100 sets the compression to 0. (Now I know why my PNGs were so huge!)

      I would suggest that setCompression() be implemented - taking values 0-9 which is what png_set_compression_level() takes. If there are no objections or discussion I will go ahead and submit a change for this via Garrit.

      I'd also like to see setQuality() removed for PNGs since it doesn't really apply and is confusing, but I understand that's a change in functionality that may or may not be desired. Would appreciate discussion/guidance on this.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              vgt Eirik Aavitsland
              Reporter:
              asm Andy M
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes