From 5d2514b86f8e88177569ee398715e2512ef9967b Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 24 Sep 2013 03:39:51 +0000 Subject: [PATCH] We can't enable optimized entropy coding unless we're using Huffman coding. This fixes a bug whereby attempting to create a progressive JPEG with arithmetic coding would fail. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@1036 632fc199-4ca6-4c93-a231-07263d6284db --- ChangeLog.txt | 5 +++++ jcmaster.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 468f09039..1bdc1b0f4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -15,6 +15,11 @@ SIMD code with NASM 0.98. [4] Fixed a Huffman encoder bug that prevented I/O suspension from working properly. +[5] Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic +entropy coding (by passing arguments of -progressive -arithmetic to cjpeg or +jpegtran, for instance) would result in an error, "Requested feature was +omitted at compile time". + 1.2.1 ===== diff --git a/jcmaster.c b/jcmaster.c index bee0cafc8..accfc7017 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -602,7 +602,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only) cinfo->num_scans = 1; } - if (cinfo->progressive_mode) /* TEMPORARY HACK ??? */ + if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */ cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */ /* Initialize my private state */