Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
None
-
4.8.x
-
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.