|
|
| version 1.1, 2001/04/10 13:22:55 | version 1.2, 2001/04/10 13:24:49 |
|---|---|
| Line 87 struct JPG_Frame { | Line 87 struct JPG_Frame { |
| char width[2]; // image width | char width[2]; // image width |
| char numComponents; // number of color components | char numComponents; // number of color components |
| }; | }; |
| // JFIF format markers | |
| #define SOI 0xD8 | |
| #define EOI 0xD9 | |
| #define APP0 0xE0 | |
| #define SOF0 0xC0 | |
| #define SOF2 0xC2 | |
| #define COM 0xFE | |
| // | // |
| Line 124 void measure_gif(Pool& pool, const Strin | Line 116 void measure_gif(Pool& pool, const Strin |
| void measure_jpeg(Pool& pool, const String *origin_string, | void measure_jpeg(Pool& pool, const String *origin_string, |
| Measure_reader& reader, int& width, int& height) { | Measure_reader& reader, int& width, int& height) { |
| // JFIF format markers | |
| const unsigned char SOI=0xD8; | |
| const unsigned char EOI=0xD9; | |
| const unsigned char APP0=0xE0; | |
| const unsigned char SOF0=0xC0; | |
| const unsigned char SOF2=0xC2; | |
| const unsigned char COM=0xFE; | |
| unsigned char *screenD_buf; | unsigned char *screenD_buf; |
| unsigned char *h_buf; | unsigned char *h_buf; |
| bool flag=false; | bool flag=false; |
| char Spec[]="JFIF"; | |
| unsigned char *prefix; | unsigned char *prefix; |
| const prefix_size=2; | const prefix_size=2; |
| Line 160 void measure_jpeg(Pool& pool, const Stri | Line 159 void measure_jpeg(Pool& pool, const Stri |
| break; | break; |
| JFIF_Header& screenD=*reinterpret_cast<JFIF_Header *>(screenD_buf); | JFIF_Header& screenD=*reinterpret_cast<JFIF_Header *>(screenD_buf); |
| if((bytes_to_int(screenD.length[0], screenD.length[1]) < 16) || | if((bytes_to_int(screenD.length[0], screenD.length[1]) < 16) || |
| strcasecmp(screenD.identifier, Spec)) flag=false; | strcasecmp(screenD.identifier, "JFIF")) flag=false; |
| } | } |
| break; | break; |
| case SOF0: | case SOF0: |