1e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* 2e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * jerror.h 3e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * 4e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Copyright (C) 1994-1997, Thomas G. Lane. 5e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * This file is part of the Independent JPEG Group's software. 6e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * For conditions of distribution and use, see the accompanying README file. 7e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * 8e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * This file defines the error and message codes for the JPEG library. 9e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * Edit this file to add new codes, or to translate the message strings to 10e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * some other language. 11e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * A set of error-reporting macros are defined too. Some applications using 12e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * the JPEG library may wish to include this file to get the error codes 13e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * and/or the macros. 14e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov */ 15e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 16e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* 17e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * To define the enum list of message codes, include this file without 18e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * defining macro JMESSAGE. To create a message string table, include it 19e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov * again with a suitable JMESSAGE definition (see jerror.c for an example). 20e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov */ 21e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifndef JMESSAGE 22e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifndef JERROR_H 23e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* First time through, define the enum list */ 24e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define JMAKE_ENUM_LIST 25e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#else 26e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ 27e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define JMESSAGE(code,string) 28e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif /* JERROR_H */ 29e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif /* JMESSAGE */ 30e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 31e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifdef JMAKE_ENUM_LIST 32e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 33e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganovtypedef enum { 34e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 35e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define JMESSAGE(code,string) code , 36e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 37e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif /* JMAKE_ENUM_LIST */ 38e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 39e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ 40e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 41e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* For maintenance convenience, list is alphabetical by message code name */ 42e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_ARITH_NOTIMPL, 43e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Sorry, there are legal restrictions on arithmetic coding") 44e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") 45e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") 46e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") 47e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") 48e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") 49e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") 50e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") 51e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") 52e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") 53e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") 54e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_LIB_VERSION, 55e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Wrong JPEG library version: library is %d, caller expects %d") 56e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") 57e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") 58e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") 59e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_PROGRESSION, 60e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") 61e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_PROG_SCRIPT, 62e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Invalid progressive parameters at scan script entry %d") 63e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") 64e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") 65e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") 66e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_STRUCT_SIZE, 67e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") 68e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") 69e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") 70e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") 71e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") 72e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") 73e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") 74e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") 75e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") 76e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") 77e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") 78e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") 79e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_EMS_READ, "Read from EMS failed") 80e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") 81e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") 82e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_FILE_READ, "Input file read error") 83e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") 84e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") 85e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") 86e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") 87e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") 88e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_INPUT_EMPTY, "Empty input file") 89e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_INPUT_EOF, "Premature end of input file") 90e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_MISMATCHED_QUANT_TABLE, 91e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Cannot transcode due to multiple use of quantization table %d") 92e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") 93e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") 94e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NOTIMPL, "Not implemented yet") 95e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") 96e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") 97e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") 98e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") 99e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") 100e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") 101e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") 102e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_QUANT_COMPONENTS, 103e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Cannot quantize more than %d color components") 104e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") 105e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") 106e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") 107e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") 108e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") 109e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") 110e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") 111e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") 112e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") 113e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") 114e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_TFILE_WRITE, 115e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Write failed on temporary file --- out of disk space?") 116e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") 117e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") 118e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") 119e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") 120e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_XMS_READ, "Read from XMS failed") 121e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") 122e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) 123e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JMSG_VERSION, JVERSION) 124e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_16BIT_TABLES, 125e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Caution: quantization tables are too coarse for baseline JPEG") 126e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_ADOBE, 127e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") 128e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") 129e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") 130e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") 131e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") 132e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") 133e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_DRI, "Define Restart Interval %u") 134e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") 135e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") 136e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_EOI, "End Of Image") 137e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") 138e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") 139e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, 140e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Warning: thumbnail image size does not match data length %u") 141e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_JFIF_EXTENSION, 142e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "JFIF extension marker: type 0x%02x, length %u") 143e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") 144e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") 145e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") 146e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") 147e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") 148e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") 149e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") 150e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") 151e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_RST, "RST%d") 152e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SMOOTH_NOTIMPL, 153e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Smoothing not supported with nonstandard sampling ratios") 154e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") 155e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") 156e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SOI, "Start of Image") 157e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SOS, "Start Of Scan: %d components") 158e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") 159e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") 160e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") 161e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") 162e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_THUMB_JPEG, 163e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "JFIF extension marker: JPEG-compressed thumbnail image, length %u") 164e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_THUMB_PALETTE, 165e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "JFIF extension marker: palette thumbnail image, length %u") 166e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_THUMB_RGB, 167e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "JFIF extension marker: RGB thumbnail image, length %u") 168e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_UNKNOWN_IDS, 169e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Unrecognized component IDs %d %d %d, assuming YCbCr") 170e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") 171e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") 172e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") 173e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_BOGUS_PROGRESSION, 174e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Inconsistent progression sequence for component %d coefficient %d") 175e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_EXTRANEOUS_DATA, 176e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") 177e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") 178e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") 179e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") 180e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") 181e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_MUST_RESYNC, 182e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov "Corrupt JPEG data: found marker 0x%02x instead of RST%d") 183e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") 184e6986e1e8d4a57987f47c215490cb080a65ee29aSvet GanovJMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") 185e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 186e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifdef JMAKE_ENUM_LIST 187e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 188e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov JMSG_LASTMSGCODE 189e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov} J_MESSAGE_CODE; 190e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 191e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#undef JMAKE_ENUM_LIST 192e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif /* JMAKE_ENUM_LIST */ 193e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 194e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ 195e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#undef JMESSAGE 196e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 197e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 198e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#ifndef JERROR_H 199e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define JERROR_H 200e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 201e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Macros to simplify using the error and trace message stuff */ 202e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* The first parameter is either type of cinfo pointer */ 203e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 204e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Fatal errors (print message and exit) */ 205e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define ERREXIT(cinfo,code) \ 206e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 207e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 208e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define ERREXIT1(cinfo,code,p1) \ 209e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 210e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 211e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 212e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define ERREXIT2(cinfo,code,p1,p2) \ 213e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 214e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 215e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[1] = (p2), \ 216e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 217e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define ERREXIT3(cinfo,code,p1,p2,p3) \ 218e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 219e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 220e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[1] = (p2), \ 221e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[2] = (p3), \ 222e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 223e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ 224e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 225e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 226e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[1] = (p2), \ 227e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[2] = (p3), \ 228e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[3] = (p4), \ 229e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 230e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define ERREXITS(cinfo,code,str) \ 231e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 232e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 233e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 234e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 235e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define MAKESTMT(stuff) do { stuff } while (0) 236e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 237e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ 238e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define WARNMS(cinfo,code) \ 239e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 240e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 241e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define WARNMS1(cinfo,code,p1) \ 242e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 243e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 244e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 245e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define WARNMS2(cinfo,code,p1,p2) \ 246e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 247e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 248e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[1] = (p2), \ 249e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 250e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 251e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov/* Informational/debugging messages */ 252e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS(cinfo,lvl,code) \ 253e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 254e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 255e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS1(cinfo,lvl,code,p1) \ 256e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 257e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 258e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 259e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS2(cinfo,lvl,code,p1,p2) \ 260e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 261e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[0] = (p1), \ 262e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_parm.i[1] = (p2), \ 263e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 264e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ 265e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 266e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ 267e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_code = (code); \ 268e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 269e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ 270e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 271e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 272e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_code = (code); \ 273e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 274e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ 275e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 276e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 277e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov _mp[4] = (p5); \ 278e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_code = (code); \ 279e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 280e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ 281e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 282e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 283e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ 284e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (cinfo)->err->msg_code = (code); \ 285e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 286e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#define TRACEMSS(cinfo,lvl,code,str) \ 287e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov ((cinfo)->err->msg_code = (code), \ 288e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov FXSYS_strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 289e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 290e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov 291e6986e1e8d4a57987f47c215490cb080a65ee29aSvet Ganov#endif /* JERROR_H */ 292