diff options
Diffstat (limited to 'Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc')
-rw-r--r-- | Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc b/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc index 37c15c2ab85..16c97afe768 100644 --- a/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc +++ b/Build/source/libs/poppler/poppler-src/goo/JpegWriter.cc @@ -9,7 +9,8 @@ // Copyright (C) 2010 Harry Roberts <harry.roberts@midnight-labs.org> // Copyright (C) 2011 Thomas Freitag <Thomas.Freitag@alfa.de> // Copyright (C) 2013 Peter Breitenlohner <peb@mppmu.mpg.de> -// Copyright (C) 2017 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2017, 2018 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2018 Martin Packman <gzlist@googlemail.com> // //======================================================================== @@ -25,6 +26,7 @@ extern "C" { struct JpegWriterPrivate { bool progressive; + bool optimize; int quality; JpegWriter::Format format; struct jpeg_compress_struct cinfo; @@ -46,16 +48,14 @@ JpegWriter::JpegWriter(int q, bool p, Format formatA) { priv = new JpegWriterPrivate; priv->progressive = p; + priv->optimize = false; priv->quality = q; priv->format = formatA; } JpegWriter::JpegWriter(Format formatA) + : JpegWriter(-1, false, formatA) { - priv = new JpegWriterPrivate; - priv->progressive = false; - priv->quality = -1; - priv->format = formatA; } JpegWriter::~JpegWriter() @@ -75,6 +75,11 @@ void JpegWriter::setProgressive(bool progressive) priv->progressive = progressive; } +void JpegWriter::setOptimize(bool optimize) +{ + priv->optimize = optimize; +} + bool JpegWriter::init(FILE *f, int width, int height, int hDPI, int vDPI) { // Setup error handler @@ -137,6 +142,9 @@ bool JpegWriter::init(FILE *f, int width, int height, int hDPI, int vDPI) jpeg_simple_progression(&priv->cinfo); } + // Set whether to compute optimal Huffman coding tables + priv->cinfo.optimize_coding = priv->optimize; + // Get ready for data jpeg_start_compress(&priv->cinfo, TRUE); |