File indexing completed on 2025-01-17 09:55:35
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef JMESSAGE
0028 #ifndef JERROR_H
0029
0030 #define JMAKE_ENUM_LIST
0031 #else
0032
0033 #define JMESSAGE(code, string)
0034 #endif
0035 #endif
0036
0037 #ifdef JMAKE_ENUM_LIST
0038
0039 typedef enum {
0040
0041 #define JMESSAGE(code, string) code,
0042
0043 #endif
0044
0045 JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d")
0046
0047
0048 #if JPEG_LIB_VERSION < 70
0049 JMESSAGE(JERR_ARITH_NOTIMPL, "Sorry, arithmetic coding is not implemented")
0050 #endif
0051 JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix")
0052 JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix")
0053 JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode")
0054 JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS")
0055 #if JPEG_LIB_VERSION >= 70
0056 JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
0057 #endif
0058 JMESSAGE(JERR_BAD_DCT_COEF,
0059 "DCT coefficient (lossy) or spatial difference (lossless) out of range")
0060 JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported")
0061 #if JPEG_LIB_VERSION >= 70
0062 JMESSAGE(JERR_BAD_DROP_SAMPLING,
0063 "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
0064 #endif
0065 JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition")
0066 JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace")
0067 JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace")
0068 JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length")
0069 JMESSAGE(JERR_BAD_LIB_VERSION,
0070 "Wrong JPEG library version: library is %d, caller expects %d")
0071 JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan")
0072 JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d")
0073 JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d")
0074 JMESSAGE(JERR_BAD_PROGRESSION,
0075 "Invalid progressive/lossless parameters Ss=%d Se=%d Ah=%d Al=%d")
0076 JMESSAGE(JERR_BAD_PROG_SCRIPT,
0077 "Invalid progressive/lossless parameters at scan script entry %d")
0078 JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors")
0079 JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d")
0080 JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d")
0081 JMESSAGE(JERR_BAD_STRUCT_SIZE,
0082 "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u")
0083 JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access")
0084 JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small")
0085 JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here")
0086 JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet")
0087 JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d")
0088 JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request")
0089 JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d")
0090 JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x")
0091 JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d")
0092 JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d")
0093 JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)")
0094 JMESSAGE(JERR_EMS_READ, "Read from EMS failed")
0095 JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed")
0096 JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan")
0097 JMESSAGE(JERR_FILE_READ, "Input file read error")
0098 JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?")
0099 JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet")
0100 JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow")
0101 JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry")
0102 JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels")
0103 JMESSAGE(JERR_INPUT_EMPTY, "Empty input file")
0104 JMESSAGE(JERR_INPUT_EOF, "Premature end of input file")
0105 JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,
0106 "Cannot transcode due to multiple use of quantization table %d")
0107 JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data")
0108 JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change")
0109 JMESSAGE(JERR_NOTIMPL, "Requested features are incompatible")
0110 JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time")
0111 #if JPEG_LIB_VERSION >= 70
0112 JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
0113 #endif
0114 JMESSAGE(JERR_NO_BACKING_STORE, "Memory limit exceeded")
0115 JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined")
0116 JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image")
0117 JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined")
0118 JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x")
0119 JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)")
0120 JMESSAGE(JERR_QUANT_COMPONENTS,
0121 "Cannot quantize more than %d color components")
0122 JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors")
0123 JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors")
0124 JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers")
0125 JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker")
0126 JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x")
0127 JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers")
0128 JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF")
0129 JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s")
0130 JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file")
0131 JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file")
0132 JMESSAGE(JERR_TFILE_WRITE,
0133 "Write failed on temporary file --- out of disk space?")
0134 JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines")
0135 JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x")
0136 JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up")
0137 JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation")
0138 JMESSAGE(JERR_XMS_READ, "Read from XMS failed")
0139 JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed")
0140 JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT_SHORT)
0141 JMESSAGE(JMSG_VERSION, JVERSION)
0142 JMESSAGE(JTRC_16BIT_TABLES,
0143 "Caution: quantization tables are too coarse for baseline JPEG")
0144 JMESSAGE(JTRC_ADOBE,
0145 "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d")
0146 JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u")
0147 JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u")
0148 JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x")
0149 JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x")
0150 JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d")
0151 JMESSAGE(JTRC_DRI, "Define Restart Interval %u")
0152 JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u")
0153 JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u")
0154 JMESSAGE(JTRC_EOI, "End Of Image")
0155 JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d")
0156 JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d")
0157 JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,
0158 "Warning: thumbnail image size does not match data length %u")
0159 JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u")
0160 JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image")
0161 JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u")
0162 JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x")
0163 JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u")
0164 JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors")
0165 JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors")
0166 JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization")
0167 JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d")
0168 JMESSAGE(JTRC_RST, "RST%d")
0169 JMESSAGE(JTRC_SMOOTH_NOTIMPL,
0170 "Smoothing not supported with nonstandard sampling ratios")
0171 JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d")
0172 JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d")
0173 JMESSAGE(JTRC_SOI, "Start of Image")
0174 JMESSAGE(JTRC_SOS, "Start Of Scan: %d components")
0175 JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d")
0176 JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d")
0177 JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s")
0178 JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s")
0179 JMESSAGE(JTRC_THUMB_JPEG,
0180 "JFIF extension marker: JPEG-compressed thumbnail image, length %u")
0181 JMESSAGE(JTRC_THUMB_PALETTE,
0182 "JFIF extension marker: palette thumbnail image, length %u")
0183 JMESSAGE(JTRC_THUMB_RGB,
0184 "JFIF extension marker: RGB thumbnail image, length %u")
0185 JMESSAGE(JTRC_UNKNOWN_IDS,
0186 "Unrecognized component IDs %d %d %d, assuming YCbCr (lossy) or RGB (lossless)")
0187 JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u")
0188 JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u")
0189 JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d")
0190 #if JPEG_LIB_VERSION >= 70
0191 JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
0192 #endif
0193 JMESSAGE(JWRN_BOGUS_PROGRESSION,
0194 "Inconsistent progression sequence for component %d coefficient %d")
0195 JMESSAGE(JWRN_EXTRANEOUS_DATA,
0196 "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x")
0197 JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment")
0198 JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code")
0199 JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d")
0200 JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file")
0201 JMESSAGE(JWRN_MUST_RESYNC,
0202 "Corrupt JPEG data: found marker 0x%02x instead of RST%d")
0203 JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG")
0204 JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines")
0205 #if JPEG_LIB_VERSION < 70
0206 JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request")
0207 #if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)
0208 JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined")
0209 JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code")
0210 #endif
0211 #endif
0212 JMESSAGE(JWRN_BOGUS_ICC, "Corrupt JPEG data: bad ICC marker")
0213 #if JPEG_LIB_VERSION < 70
0214 JMESSAGE(JERR_BAD_DROP_SAMPLING,
0215 "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c")
0216 #endif
0217 JMESSAGE(JERR_BAD_RESTART,
0218 "Invalid restart interval %d; must be an integer multiple of the number of MCUs in an MCU row (%d)")
0219
0220 #ifdef JMAKE_ENUM_LIST
0221
0222 JMSG_LASTMSGCODE
0223 } J_MESSAGE_CODE;
0224
0225 #undef JMAKE_ENUM_LIST
0226 #endif
0227
0228
0229 #undef JMESSAGE
0230
0231
0232 #ifndef JERROR_H
0233 #define JERROR_H
0234
0235
0236
0237
0238
0239 #define ERREXIT(cinfo, code) \
0240 ((cinfo)->err->msg_code = (code), \
0241 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0242 #define ERREXIT1(cinfo, code, p1) \
0243 ((cinfo)->err->msg_code = (code), \
0244 (cinfo)->err->msg_parm.i[0] = (p1), \
0245 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0246 #define ERREXIT2(cinfo, code, p1, p2) \
0247 ((cinfo)->err->msg_code = (code), \
0248 (cinfo)->err->msg_parm.i[0] = (p1), \
0249 (cinfo)->err->msg_parm.i[1] = (p2), \
0250 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0251 #define ERREXIT3(cinfo, code, p1, p2, p3) \
0252 ((cinfo)->err->msg_code = (code), \
0253 (cinfo)->err->msg_parm.i[0] = (p1), \
0254 (cinfo)->err->msg_parm.i[1] = (p2), \
0255 (cinfo)->err->msg_parm.i[2] = (p3), \
0256 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0257 #define ERREXIT4(cinfo, code, p1, p2, p3, p4) \
0258 ((cinfo)->err->msg_code = (code), \
0259 (cinfo)->err->msg_parm.i[0] = (p1), \
0260 (cinfo)->err->msg_parm.i[1] = (p2), \
0261 (cinfo)->err->msg_parm.i[2] = (p3), \
0262 (cinfo)->err->msg_parm.i[3] = (p4), \
0263 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0264 #define ERREXIT6(cinfo, code, p1, p2, p3, p4, p5, p6) \
0265 ((cinfo)->err->msg_code = (code), \
0266 (cinfo)->err->msg_parm.i[0] = (p1), \
0267 (cinfo)->err->msg_parm.i[1] = (p2), \
0268 (cinfo)->err->msg_parm.i[2] = (p3), \
0269 (cinfo)->err->msg_parm.i[3] = (p4), \
0270 (cinfo)->err->msg_parm.i[4] = (p5), \
0271 (cinfo)->err->msg_parm.i[5] = (p6), \
0272 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0273 #define ERREXITS(cinfo, code, str) \
0274 ((cinfo)->err->msg_code = (code), \
0275 strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
0276 (cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
0277 (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
0278
0279 #define MAKESTMT(stuff) do { stuff } while (0)
0280
0281
0282 #define WARNMS(cinfo, code) \
0283 ((cinfo)->err->msg_code = (code), \
0284 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
0285 #define WARNMS1(cinfo, code, p1) \
0286 ((cinfo)->err->msg_code = (code), \
0287 (cinfo)->err->msg_parm.i[0] = (p1), \
0288 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
0289 #define WARNMS2(cinfo, code, p1, p2) \
0290 ((cinfo)->err->msg_code = (code), \
0291 (cinfo)->err->msg_parm.i[0] = (p1), \
0292 (cinfo)->err->msg_parm.i[1] = (p2), \
0293 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
0294
0295
0296 #define TRACEMS(cinfo, lvl, code) \
0297 ((cinfo)->err->msg_code = (code), \
0298 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
0299 #define TRACEMS1(cinfo, lvl, code, p1) \
0300 ((cinfo)->err->msg_code = (code), \
0301 (cinfo)->err->msg_parm.i[0] = (p1), \
0302 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
0303 #define TRACEMS2(cinfo, lvl, code, p1, p2) \
0304 ((cinfo)->err->msg_code = (code), \
0305 (cinfo)->err->msg_parm.i[0] = (p1), \
0306 (cinfo)->err->msg_parm.i[1] = (p2), \
0307 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
0308 #define TRACEMS3(cinfo, lvl, code, p1, p2, p3) \
0309 MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
0310 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \
0311 (cinfo)->err->msg_code = (code); \
0312 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
0313 #define TRACEMS4(cinfo, lvl, code, p1, p2, p3, p4) \
0314 MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
0315 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
0316 (cinfo)->err->msg_code = (code); \
0317 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
0318 #define TRACEMS5(cinfo, lvl, code, p1, p2, p3, p4, p5) \
0319 MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
0320 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
0321 _mp[4] = (p5); \
0322 (cinfo)->err->msg_code = (code); \
0323 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
0324 #define TRACEMS8(cinfo, lvl, code, p1, p2, p3, p4, p5, p6, p7, p8) \
0325 MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
0326 _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \
0327 _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \
0328 (cinfo)->err->msg_code = (code); \
0329 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
0330 #define TRACEMSS(cinfo, lvl, code, str) \
0331 ((cinfo)->err->msg_code = (code), \
0332 strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
0333 (cinfo)->err->msg_parm.s[JMSG_STR_PARM_MAX - 1] = '\0', \
0334 (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
0335
0336 #endif