From fa9ff8e88cfaebc59536d1ab5ebb52be8a15088f Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 21 Jun 2011 06:17:10 +0000 Subject: [PATCH] Restore compatibility with the jpeg-6b error enum, even if arithmetic coding is enabled. git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@667 632fc199-4ca6-4c93-a231-07263d6284db --- ChangeLog.txt | 12 +++++------- jerror.h | 8 ++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6c85ad3..f4f774e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,13 +8,11 @@ the application was invoked using I/O redirection [2] The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding support in libjpeg-turbo v1.1.0 introduced several new error constants in jerror.h, and these were mistakenly enabled for all emulation modes, causing -the error enum in libjpeg-turbo to have different values than the same enum in -libjpeg. This represents an ABI incompatibility, and it caused problems with -applications that took specific action based on libjpeg error values. The fix -was to include the new error constants conditionally based on whether libjpeg -v7 or v8 emulation or arithmetic coding support was enabled. Note that to -achieve full ABI compatibility with jpeg-6b, it is necessary to build -libjpeg-turbo without arithmetic coding support. +the error enum in libjpeg-turbo to sometimes have different values than the +same enum in libjpeg. This represents an ABI incompatibility, and it caused +problems with rare applications that took specific action based on a particular +error value. The fix was to include the new error constants conditionally +based on whether libjpeg v7 or v8 emulation was enabled. [3] Fixed an issue whereby Windows applications that used libjpeg-turbo would fail to compile if the Windows system headers were included before jpeglib.h. diff --git a/jerror.h b/jerror.h index 0f10f0e..275086e 100644 --- a/jerror.h +++ b/jerror.h @@ -103,7 +103,7 @@ JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") JMESSAGE(JERR_NOTIMPL, "Not implemented yet") JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") -#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED) || JPEG_LIB_VERSION >= 70 +#if JPEG_LIB_VERSION >= 70 JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") #endif JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") @@ -183,7 +183,7 @@ JMESSAGE(JTRC_UNKNOWN_IDS, JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") -#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED) || JPEG_LIB_VERSION >= 70 +#if JPEG_LIB_VERSION >= 70 JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") #endif JMESSAGE(JWRN_BOGUS_PROGRESSION, @@ -200,6 +200,10 @@ JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") #if JPEG_LIB_VERSION < 70 JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") +#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED) +JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") +JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") +#endif #endif #ifdef JMAKE_ENUM_LIST -- 2.40.0