diff -u jpeg-6b/jerror.h jpglib/jerror.h --- jpeg-6b/jerror.h Sat Oct 18 20:59:10 1997 +++ jpglib/jerror.h Sat Jun 13 17:38:13 1998 @@ -36,7 +36,7 @@ #endif /* JMAKE_ENUM_LIST */ -JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %ld") /* Must be first entry! */ /* For maintenance convenience, list is alphabetical by message code name */ JMESSAGE(JERR_ARITH_NOTIMPL, @@ -44,68 +44,68 @@ JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") -JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %ld in SOS") JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") -JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") +JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %ld not supported") JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") JMESSAGE(JERR_BAD_LIB_VERSION, - "Wrong JPEG library version: library is %d, caller expects %d") + "Wrong JPEG library version: library is %ld, caller expects %ld") JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") -JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") -JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %ld") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %ld") JMESSAGE(JERR_BAD_PROGRESSION, - "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") + "Invalid progressive parameters Ss=%ld Se=%ld Ah=%ld Al=%ld") JMESSAGE(JERR_BAD_PROG_SCRIPT, - "Invalid progressive parameters at scan script entry %d") + "Invalid progressive parameters at scan script entry %ld") JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") -JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") -JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %ld") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %ld") JMESSAGE(JERR_BAD_STRUCT_SIZE, - "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") + "JPEG parameter struct mismatch: library thinks size is %lu, caller expects %lu") JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") -JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %ld, max %ld") JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") -JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") -JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") -JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") -JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %ld") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%lx") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %ld") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %ld") JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") -JMESSAGE(JERR_EMS_READ, "Read from EMS failed") -JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +//JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +//JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") JMESSAGE(JERR_FILE_READ, "Input file read error") JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") -JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %lu pixels") JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, - "Cannot transcode due to multiple use of quantization table %d") + "Cannot transcode due to multiple use of quantization table %ld") 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") JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") -JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02lx was not defined") JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") -JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") -JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") -JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02lx was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02lx 0x%02lx") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %ld)") JMESSAGE(JERR_QUANT_COMPONENTS, - "Cannot quantize more than %d color components") -JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") -JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") + "Cannot quantize more than %ld color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %ld colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %ld colors") JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") -JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02lx") JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") @@ -114,72 +114,78 @@ JMESSAGE(JERR_TFILE_WRITE, "Write failed on temporary file --- out of disk space?") JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") -JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02lx") JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") -JMESSAGE(JERR_XMS_READ, "Read from XMS failed") -JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +//JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +//JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) JMESSAGE(JMSG_VERSION, JVERSION) + +#ifndef JFIF_DT + JMESSAGE(JTRC_16BIT_TABLES, "Caution: quantization tables are too coarse for baseline JPEG") JMESSAGE(JTRC_ADOBE, - "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") -JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") -JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") -JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") -JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") -JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") -JMESSAGE(JTRC_DRI, "Define Restart Interval %u") -JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") -JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") + "Adobe APP14 marker: version %ld, flags 0x%04lx 0x%04lx, transform %ld") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %lu") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %lu") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02lx: 0x%02lx") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02lx") +JMESSAGE(JTRC_DQT, "Define Quantization Table %ld precision %ld") +JMESSAGE(JTRC_DRI, "Define Restart Interval %lu") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %lu") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %lu") JMESSAGE(JTRC_EOI, "End Of Image") -JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") -JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_HUFFBITS, " %3ld %3ld %3ld %3ld %3ld %3ld %3ld %3ld") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %ld.%02ld, density %ldx%ld %ld") JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, - "Warning: thumbnail image size does not match data length %u") + "Warning: thumbnail image size does not match data length %lu") JMESSAGE(JTRC_JFIF_EXTENSION, - "JFIF extension marker: type 0x%02x, length %u") -JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") -JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") -JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") -JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") -JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") -JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") -JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") -JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") -JMESSAGE(JTRC_RST, "RST%d") + "JFIF extension marker: type 0x%02lx, length %lu") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %ld x %ld thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02lx, length %lu") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02lx") +JMESSAGE(JTRC_QUANTVALS, " %4lu %4lu %4lu %4lu %4lu %4llu %4lu %4lu") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %ld = %ld*%ld*%ld colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %ld colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %ld colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02lx, recovery action %ld") +JMESSAGE(JTRC_RST, "RST%ld") JMESSAGE(JTRC_SMOOTH_NOTIMPL, "Smoothing not supported with nonstandard sampling ratios") -JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") -JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02lx: width=%lu, height=%lu, components=%ld") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %ld: %ldhx%ldv q=%ld") JMESSAGE(JTRC_SOI, "Start of Image") -JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") -JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") -JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_SOS, "Start Of Scan: %ld components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %ld: dc=%ld ac=%ld") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%ld, Se=%ld, Ah=%ld, Al=%ld") JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") JMESSAGE(JTRC_THUMB_JPEG, - "JFIF extension marker: JPEG-compressed thumbnail image, length %u") + "JFIF extension marker: JPEG-compressed thumbnail image, length %lu") JMESSAGE(JTRC_THUMB_PALETTE, - "JFIF extension marker: palette thumbnail image, length %u") + "JFIF extension marker: palette thumbnail image, length %lu") JMESSAGE(JTRC_THUMB_RGB, - "JFIF extension marker: RGB thumbnail image, length %u") + "JFIF extension marker: RGB thumbnail image, length %lu") JMESSAGE(JTRC_UNKNOWN_IDS, - "Unrecognized component IDs %d %d %d, assuming YCbCr") -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") + "Unrecognized component IDs %ld %ld %ld, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %lu") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %lu") + +#endif + +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %ld") JMESSAGE(JWRN_BOGUS_PROGRESSION, - "Inconsistent progression sequence for component %d coefficient %d") + "Inconsistent progression sequence for component %ld coefficient %ld") JMESSAGE(JWRN_EXTRANEOUS_DATA, - "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") + "Corrupt JPEG data: %lu extraneous bytes before marker 0x%02lx") JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") -JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %ld.%02ld") JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") JMESSAGE(JWRN_MUST_RESYNC, - "Corrupt JPEG data: found marker 0x%02x instead of RST%d") + "Corrupt JPEG data: found marker 0x%02lx instead of RST%ld") JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") @@ -248,6 +254,8 @@ (cinfo)->err->msg_parm.i[1] = (p2), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#ifndef JFIF_DT + /* Informational/debugging messages */ #define TRACEMS(cinfo,lvl,code) \ ((cinfo)->err->msg_code = (code), \ @@ -287,5 +295,18 @@ ((cinfo)->err->msg_code = (code), \ strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#else + +#define TRACEMS(cinfo,lvl,code) +#define TRACEMS1(cinfo,lvl,code,p1) +#define TRACEMS2(cinfo,lvl,code,p1,p2) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) +#define TRACEMSS(cinfo,lvl,code,str) + +#endif #endif /* JERROR_H */ diff -u jpeg-6b/jmemmgr.c jpglib/jmemmgr.c --- jpeg-6b/jmemmgr.c Tue Apr 15 02:56:37 1997 +++ jpglib/jmemmgr.c Thu Jun 4 20:30:48 1998 @@ -36,6 +36,11 @@ #endif #endif +#ifdef JFIF_DT +#define jpeg_get_small jpeg_get_large +#define jpeg_free_small jpeg_free_large +#endif + /* * Some important notes: diff -u jpeg-6b/jmorecfg.h jpglib/jmorecfg.h --- jpeg-6b/jmorecfg.h Sun Aug 10 01:58:56 1997 +++ jpglib/jmorecfg.h Sun Jun 14 16:32:07 1998 @@ -10,6 +10,7 @@ * optimizations. Most users will not need to touch this file. */ +#undef GLOBAL /* * Define BITS_IN_JSAMPLE as either @@ -264,6 +265,10 @@ #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ #define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ +#if defined(JFIF_DT) && !defined(__HAVE_68881__) +#undef DCT_FLOAT_SUPPORTED +#endif + /* Encoder capability options: */ #undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ @@ -285,7 +290,7 @@ #undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ +#undef SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */