Mastodon
Programmierung

JPEG Errorcodes etc.

PEG JPG Errorcodes Fehlermeldungen Abfangen Trapping

JPEG-Errorcodes:
#36 : m:=m+’Output file write error — out of disk space?’;
#51 = JERR_NO_QUANT_TABLE: Quantization table 0x%02x was not defined
#52 : File is not a JPEG-File (for example if you try to read a GIF as a JPG)
#53 = JERR_OUT_OF_MEMORY: Insufficient memory (case %d)
#60 : JPEG file is incomplete
#67 : JPEG file is incomplete (like #60 – don’t know where the difference)

 How to trap a JPEG-Error?

[code lang=”delphi”]Image1.picture.loadfromfile(FileName);
if Image1.picture.graphic is TJpegImage then begin
try
TJPEGImage(Image1.picture.graphic).dibneeded;
except
on E:Exception do
if (E.message=’JPEG error #67′) then begin
showmessage(‘Incomplete JPEG’)
end;
end;
end;
[/code]

hier noch eine komplette Liste von Fehlermeldungen die ich im Web gefunden habe:

[code lang=”delphi”] 0 cstrJMSG_NOMESSAGE ‘Bogus message code %d’; (* Must be first entry! *)
1 cstrJERR_ARITH_NOTIMPL ‘Sorry, there are legal restrictions on arithmetic coding’
2 cstrJERR_BAD_ALIGN_TYPE ‘ALIGN_TYPE is wrong, please fix’
3 cstrJERR_BAD_ALLOC_CHUNK ‘MAX_ALLOC_CHUNK is wrong, please fix’
4 cstrJERR_BAD_BUFFER_MODE ‘Bogus buffer control mode’
5 cstrJERR_BAD_COMPONENT_ID ‘Invalid component ID %d in SOS’
6 cstrJERR_BAD_DCTSIZE ‘IDCT output block size %d not supported’
7 cstrJERR_BAD_IN_COLORSPACE ‘Bogus input colorspace’
8 cstrJERR_BAD_J_COLORSPACE ‘Bogus JPEG colorspace’
9 cstrJERR_BAD_LENGTH ‘Bogus marker length’
10 cstrJERR_BAD_LIB_VERSION ‘Wrong JPEG library version: library is %d, caller expects %d’
11 cstrJERR_BAD_MCU_SIZE ‘Sampling factors too large for interleaved scan’
12 cstrJERR_BAD_POOL_ID ‘Invalid memory pool code %d’
13 cstrJERR_BAD_PRECISION ‘Unsupported JPEG data precision %d’
14 cstrJERR_BAD_PROGRESSION ‘Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d’
15 cstrJERR_BAD_PROG_SCRIPT ‘Invalid progressive parameters at scan script entry %d’
16 cstrJERR_BAD_SAMPLING ‘Bogus sampling factors’
17 cstrJERR_BAD_SCAN_SCRIPT ‘Invalid scan script at entry %d’
18 cstrJERR_BAD_STATE ‘Improper call to JPEG library in state %d’
19 cstrJERR_BAD_STRUCT_SIZE ‘JPEG parameter struct mismatch: library thinks size is %u, caller expects %u’
20 cstrJERR_BAD_VIRTUAL_ACCESS ‘Bogus virtual array access’
21 cstrJERR_BUFFER_SIZE ‘Buffer passed to JPEG library is too small’
22 cstrJERR_CANT_SUSPEND ‘Suspension not allowed here’
23 cstrJERR_CCIR601_NOTIMPL ‘CCIR601 sampling not implemented yet’
24 cstrJERR_COMPONENT_COUNT ‘Too many color components: %d, max %d’
25 cstrJERR_CONVERSION_NOTIMPL ‘Unsupported color conversion request’
26 cstrJERR_DAC_INDEX ‘Bogus DAC index %d’
27 cstrJERR_DAC_VALUE ‘Bogus DAC value 0x%x’
28 cstrJERR_DHT_COUNTS ‘Bogus DHT counts’
29 cstrJERR_DHT_INDEX ‘Bogus DHT index %d’
30 cstrJERR_DQT_INDEX ‘Bogus DQT index %d’
31 cstrJERR_EMPTY_IMAGE ‘Empty JPEG image (DNL not supported)’
32 cstrJERR_EMS_READ ‘Read from EMS failed’
33 cstrJERR_EMS_WRITE ‘Write to EMS failed’
34 cstrJERR_EOI_EXPECTED ‘Didn”t expect more than one scan’
35 cstrJERR_FILE_READ ‘Input file read error’
36 cstrJERR_FILE_WRITE ‘Output file write error — out of disk space?’
37 cstrJERR_FRACT_SAMPLE_NOTIMPL ‘Fractional sampling not implemented yet’
38 cstrJERR_HUFF_CLEN_OVERFLOW ‘Huffman code size table overflow’
39 cstrJERR_HUFF_MISSING_CODE ‘Missing Huffman code table entry’
40 cstrJERR_IMAGE_TOO_BIG ‘Maximum supported image dimension is %u pixels’
41 cstrJERR_INPUT_EMPTY ‘Empty input file’
42 cstrJERR_INPUT_EOF ‘Premature end of input file’
43 cstrJERR_MISMATCHED_QUANT_TABLE ‘Cannot transcode due to multiple use of quantization table %d’
44 cstrJERR_MISSING_DATA ‘Scan script does not transmit all data’
45 cstrJERR_MODE_CHANGE ‘Invalid color quantization mode change’
46 cstrJERR_NOTIMPL ‘Not implemented yet’
47 cstrJERR_NOT_COMPILED ‘Requested feature was omitted at compile time’
48 cstrJERR_NO_BACKING_STORE ‘Backing store not supported’
49 cstrJERR_NO_HUFF_TABLE ‘Huffman table 0x%02x was not defined’
50 cstrJERR_NO_IMAGE ‘JPEG datastream contains no image’
51 cstrJERR_NO_QUANT_TABLE ‘Quantization table 0x%02x was not defined’
52 cstrJERR_NO_SOI ‘Not a JPEG file: starts with 0x%02x 0x%02x’
53 cstrJERR_OUT_OF_MEMORY ‘Insufficient memory (case %d)’
54 cstrJERR_QUANT_COMPONENTS ‘Cannot quantize more than %d color components’
55 cstrJERR_QUANT_FEW_COLORS ‘Cannot quantize to fewer than %d colors’
56 cstrJERR_QUANT_MANY_COLORS ‘Cannot quantize to more than %d colors’
57 cstrJERR_SOF_DUPLICATE ‘Invalid JPEG file structure: two SOF markers’
58 cstrJERR_SOF_NO_SOS ‘Invalid JPEG file structure: missing SOS marker’
59 cstrJERR_SOF_UNSUPPORTED ‘Unsupported JPEG process: SOF type 0x%02x’
60 cstrJERR_SOI_DUPLICATE ‘Invalid JPEG file structure: two SOI markers’
61 cstrJERR_SOS_NO_SOF ‘Invalid JPEG file structure: SOS before SOF’
62 cstrJERR_TFILE_CREATE ‘Failed to create temporary file %s’
63 cstrJERR_TFILE_READ ‘Read failed on temporary file’
64 cstrJERR_TFILE_SEEK ‘Seek failed on temporary file’
65 cstrJERR_TFILE_WRITE ‘Write failed on temporary file — out of disk space?’
66 cstrJERR_TOO_LITTLE_DATA ‘Application transferred too few scanlines’
67 cstrJERR_UNKNOWN_MARKER ‘Unsupported marker type 0x%02x’
68 cstrJERR_VIRTUAL_BUG ‘Virtual array controller messed up’
69 cstrJERR_WIDTH_OVERFLOW ‘Image too wide for this implementation’
70 cstrJERR_XMS_READ ‘Read from XMS failed’
71 cstrJERR_XMS_WRITE ‘Write to XMS failed’
72 cstrJMSG_COPYRIGHT cstrJCOPYRIGHT
73 cstrJMSG_VERSION cstrJVERSION
74 cstrJTRC_16BIT_TABLES ‘Caution: quantization tables are too coarse for baseline JPEG’
75 cstrJTRC_ADOBE ‘Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d’
76 cstrJTRC_APP0 ‘Unknown APP0 marker (not JFIF), length %u’
77 cstrJTRC_APP14 ‘Unknown APP14 marker (not Adobe), length %u’
78 cstrJTRC_DAC ‘Define Arithmetic Table 0x%02x: 0x%02x’
79 cstrJTRC_DHT ‘Define Huffman Table 0x%02x’
80 cstrJTRC_DQT ‘Define Quantization Table %d precision %d’
81 cstrJTRC_DRI ‘Define Restart Interval %u’
82 cstrJTRC_EMS_CLOSE ‘Freed EMS handle %u’
83 cstrJTRC_EMS_OPEN ‘Obtained EMS handle %u’
84 cstrJTRC_EOI ‘End Of Image’
85 cstrJTRC_HUFFBITS ‘ %3d %3d %3d %3d %3d %3d %3d %3d’
86 cstrJTRC_JFIF ‘JFIF APP0 marker, density %dx%d %d’
87 cstrJTRC_JFIF_BADTHUMBNAILSIZE ‘Warning: thumbnail image size does not match data length %u’
88 cstrJTRC_JFIF_MINOR ‘Unknown JFIF minor revision number %d.%02d’
89 cstrJTRC_JFIF_THUMBNAIL ‘ with %d x %d thumbnail image’
90 cstrJTRC_MISC_MARKER ‘Skipping marker 0x%02x, length %u’
91 cstrJTRC_PARMLESS_MARKER ‘Unexpected marker 0x%02x’
92 cstrJTRC_QUANTVALS ‘ %4u %4u %4u %4u %4u %4u %4u %4u’
93 cstrJTRC_QUANT_3_NCOLORS ‘Quantizing to %d = %d*%d*%d colors’
94 cstrJTRC_QUANT_NCOLORS ‘Quantizing to %d colors’
95 cstrJTRC_QUANT_SELECTED ‘Selected %d colors for quantization’
96 cstrJTRC_RECOVERY_ACTION ‘At marker 0x%02x, recovery action %d’
97 cstrJTRC_RST ‘RST%d’
98 cstrJTRC_SMOOTH_NOTIMPL ‘Smoothing not supported with nonstandard sampling ratios’
99 cstrJTRC_SOF ‘Start Of Frame 0x%02x: width=%u, height=%u, components=%d’
100 cstrJTRC_SOF_COMPONENT ‘ Component %d: %dhx%dv q=%d’
101 cstrJTRC_SOI ‘Start of Image’
102 cstrJTRC_SOS ‘Start Of Scan: %d components’
103 cstrJTRC_SOS_COMPONENT ‘ Component %d: dc=%d ac=%d’
104 cstrJTRC_SOS_PARAMS ‘ Ss=%d, Se=%d, Ah=%d, Al=%d’
105 cstrJTRC_TFILE_CLOSE ‘Closed temporary file %s’
106 cstrJTRC_TFILE_OPEN ‘Opened temporary file %s’
107 cstrJTRC_UNKNOWN_IDS ‘Unrecognized component IDs %d %d %d, assuming YCbCr’
108 cstrJTRC_XMS_CLOSE ‘Freed XMS handle %u’
109 cstrJTRC_XMS_OPEN ‘Obtained XMS handle %u’
110 cstrJWRN_ADOBE_XFORM ‘Unknown Adobe color transform code %d’
111 cstrJWRN_BOGUS_PROGRESSION ‘Inconsistent progression sequence for component %d coefficient %d’
112 cstrJWRN_EXTRANEOUS_DATA ‘Corrupt JPEG data: %u extraneous bytes before marker 0x%02x’
113 cstrJWRN_HIT_MARKER ‘Corrupt JPEG data: premature end of data segment’
114 cstrJWRN_HUFF_BAD_CODE ‘Corrupt JPEG data: bad Huffman code’
115 cstrJWRN_JFIF_MAJOR ‘Warning: unknown JFIF revision number %d.%02d’
116 cstrJWRN_JPEG_EOF ‘Premature end of JPEG file’
117 cstrJWRN_MUST_RESYNC ‘Corrupt JPEG data: found marker 0x%02x instead of RST%d’
118 cstrJWRN_NOT_SEQUENTIAL ‘Invalid SOS parameters for sequential JPEG’
119 cstrJWRN_TOO_MUCH_DATA ‘Application transferred too many scanlines’
[/code]

Source: http://community.borland.com/article/0,1410,20433,00.html

[tags]Delphi, Graphic[/tags]

0 Kommentare zu “JPEG Errorcodes etc.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.