# include file for Perl parsing of JPEG files $mark_code[0] = 'ff00' ; $mark_text[0] = 'stuffed zero in encoded data' ; # x00 $mark_code[1] = 'rsrv' ; $mark_text[1] = 'RESERVED (arithmetic coding)' ; # x01 for ($mark_i = 2; $mark_i <= ord("\xbf"); $mark_i++) { $mark_code[$mark_i] = 'rsrv' ; $mark_text[$mark_i] = 'RESERVED' ; } # Start Of Frame markers, non-differential, Huffman coding $mark_code[ord("\xc0")] = 'SOF0' ; $mark_text[ord("\xc0")] = 'Start Of Frame, non-differential, Huffman coded Baseline DCT' ; $mark_code[ord("\xc1")] = 'SOF1' ; $mark_text[ord("\xc1")] = 'Start Of Frame, non-differential, Huffman coded Extended sequential DCT' ; $mark_code[ord("\xc2")] = 'SOF2' ; $mark_text[ord("\xc2")] = 'Start Of Frame, non-differential, Huffman coded Progressive DCT' ; $mark_code[ord("\xc3")] = 'SOF3' ; $mark_text[ord("\xc3")] = 'Start Of Frame, non-differential, Huffman coded Lossless (sequential)' ; # Huffman table specification $mark_code[ord("\xc4")] = 'DHT ' ; $mark_text[ord("\xc4")] = 'Define Huffman table(s)' ; # Start Of Frame markers, differential, Huffman coding $mark_code[ord("\xc5")] = 'SOF5' ; $mark_text[ord("\xc5")] = 'Start Of Frame, differential, Huffman coded sequential DCT' ; $mark_code[ord("\xc6")] = 'SOF6' ; $mark_text[ord("\xc6")] = 'Start Of Frame, differential, Huffman coded Progressive DCT' ; $mark_code[ord("\xc7")] = 'SOF7' ; $mark_text[ord("\xc7")] = 'Start Of Frame, differential, Huffman coded Lossless (sequential)' ; # Start Of Frame markers, non-differential, arithmetic coding $mark_code[ord("\xc8")] = 'JPG ' ; $mark_text[ord("\xc8")] = 'RESERVED for JPEG extension' ; $mark_code[ord("\xc9")] = 'SOF9' ; $mark_text[ord("\xc9")] = 'Start Of Frame, non-differential, arithmetic coded Extended sequential DCT' ; $mark_code[ord("\xca")] = 'SOFA' ; $mark_text[ord("\xca")] = 'Start Of Frame, non-differential, arithmetic coded Progressive DCT' ; $mark_code[ord("\xcb")] = 'SOFB' ; $mark_text[ord("\xcb")] = 'Start Of Frame, non-differential, arithmetic coded Lossless (sequential)' ; # Arithmetic coding conditioning specification $mark_code[ord("\xcc")] = 'DAC?' ; $mark_text[ord("\xcc")] = 'Define arithmetic coding conditioning(s)' ; # Start Of Frame markers, differential, arithmetic coding $mark_code[ord("\xcd")] = 'SOFD' ; $mark_text[ord("\xcd")] = 'Start Of Frame, differential, arithmetic coded sequential DCT' ; $mark_code[ord("\xce")] = 'SOFE' ; $mark_text[ord("\xce")] = 'Start Of Frame, differential, arithmetic coded Progressive DCT' ; $mark_code[ord("\xcf")] = 'SOFF' ; $mark_text[ord("\xcf")] = 'Start Of Frame, differential, arithmetic coded Lossless (sequential)' ; # Restart interval termination $mark_code[ord("\xd0")] = 'RST0' ; $mark_text[ord("\xd0")] = 'Restart with count 0 modulo 8' ; $mark_code[ord("\xd1")] = 'RST1' ; $mark_text[ord("\xd1")] = 'Restart with count 1 modulo 8' ; $mark_code[ord("\xd2")] = 'RST2' ; $mark_text[ord("\xd2")] = 'Restart with count 2 modulo 8' ; $mark_code[ord("\xd3")] = 'RST3' ; $mark_text[ord("\xd3")] = 'Restart with count 3 modulo 8' ; $mark_code[ord("\xd4")] = 'RST4' ; $mark_text[ord("\xd4")] = 'Restart with count 4 modulo 8' ; $mark_code[ord("\xd5")] = 'RST5' ; $mark_text[ord("\xd5")] = 'Restart with count 5 modulo 8' ; $mark_code[ord("\xd6")] = 'RST6' ; $mark_text[ord("\xd6")] = 'Restart with count 6 modulo 8' ; $mark_code[ord("\xd7")] = 'RST7' ; $mark_text[ord("\xd7")] = 'Restart with count 7 modulo 8' ; # Other markers $mark_code[ord("\xd8")] = 'SOI ' ; $mark_text[ord("\xd8")] = 'Start of image' ; $mark_code[ord("\xd9")] = 'EOI ' ; $mark_text[ord("\xd9")] = 'End of image' ; $mark_code[ord("\xda")] = 'SOS ' ; $mark_text[ord("\xda")] = 'Start of scan' ; $mark_code[ord("\xdb")] = 'DQT ' ; $mark_text[ord("\xdb")] = 'Define quantization table(s)' ; $mark_code[ord("\xdc")] = 'DNL ' ; $mark_text[ord("\xdc")] = 'Define number of lines' ; $mark_code[ord("\xdd")] = 'DRI ' ; $mark_text[ord("\xdd")] = 'Define restart interval' ; $mark_code[ord("\xde")] = 'DHP ' ; $mark_text[ord("\xde")] = 'Define hierarchical progression' ; $mark_code[ord("\xde")] = 'EXP ' ; $mark_text[ord("\xde")] = 'Expand reference component(s)' ; $mark_code[ord("\xe0")] = 'APP0' ; $mark_text[ord("\xe0")] = 'Application segment 0' ; $mark_code[ord("\xe1")] = 'APP1' ; $mark_text[ord("\xe1")] = 'Application segment 1' ; $mark_code[ord("\xe2")] = 'APP2' ; $mark_text[ord("\xe2")] = 'Application segment 2' ; $mark_code[ord("\xe3")] = 'APP3' ; $mark_text[ord("\xe3")] = 'Application segment 3' ; $mark_code[ord("\xe4")] = 'APP4' ; $mark_text[ord("\xe4")] = 'Application segment 4' ; $mark_code[ord("\xe5")] = 'APP5' ; $mark_text[ord("\xe5")] = 'Application segment 5' ; $mark_code[ord("\xe6")] = 'APP6' ; $mark_text[ord("\xe6")] = 'Application segment 6' ; $mark_code[ord("\xe7")] = 'APP7' ; $mark_text[ord("\xe7")] = 'Application segment 7' ; for ($mark_i = ord("\xe8"); $mark_i <= ord("\xef"); $mark_i++) { $mark_code[$mark_i] = '????' ; $mark_text[$mark_i] = 'UNKNOWN' ; } $mark_code[ord("\xf0")] = 'JPG0' ; $mark_text[ord("\xf0")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf1")] = 'JPG1' ; $mark_text[ord("\xf1")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf2")] = 'JPG2' ; $mark_text[ord("\xf2")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf3")] = 'JPG3' ; $mark_text[ord("\xf3")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf4")] = 'JPG4' ; $mark_text[ord("\xf4")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf5")] = 'JPG5' ; $mark_text[ord("\xf5")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf6")] = 'JPG6' ; $mark_text[ord("\xf6")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf7")] = 'JPG7' ; $mark_text[ord("\xf7")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf8")] = 'JPG8' ; $mark_text[ord("\xf8")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xf9")] = 'JPG9' ; $mark_text[ord("\xf9")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xfa")] = 'JPGA' ; $mark_text[ord("\xfa")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xfb")] = 'JPGB' ; $mark_text[ord("\xfb")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xfc")] = 'JPGC' ; $mark_text[ord("\xfc")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xfd")] = 'JPGD' ; $mark_text[ord("\xfd")] = 'RESERVED for JPEG extensions' ; $mark_code[ord("\xfe")] = 'COM ' ; $mark_text[ord("\xfe")] = 'Comment' ; 1 ;