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

Support additional JPEG write options: 'optimize' and 'progressive'

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • None
    • 4.8.x
    • Image formats
    • None
    • I8d0bd6a712b8a365265b7bd517e136b0755b90cb

    Description

      There are two options in libjpeg which would be nice to expose for writing JPEGs: the optimize option and progressive scan option. These are both lossless operations, so they do not change the image's quality. Using these switches can result in smaller jpeg files.

      jpegtran exposes these as the following command line switches:

           -optimize	Perform optimization of entropy encoding parameters.
           -progressive	Create progressive JPEG file.
      

      Looking at the jpegtran source, these should be dead-simple to implement in write_jpeg_image() in qjpeghandler.cpp.

      For optimize simply turn this on in the cinfo:

      cinfo.optimize_coding = TRUE;
      

      For progressive, simply call this on the completed cinfo:

      jpeg_simple_progression(&cinfo);
      

      To access the new options via QImageIOHandler::setOption(), two new QImageIOHandler::ImageOption options would have to be added and then supported in QJpegHandlerPrivate.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            asm Andy M
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes