Subject: Re: Infos from JPEG-Header

From: [email-masked] (Ronald Boucher)
Date: 27 Jun 1994 10:15:21 -0400

[email-masked] (Andrea Soller) writes:

>Hi, 
>does anybody know about getting information (image size) from the
>(compressed) JPEG-Header without decompressing the whole file with 
>"jpeg_decompress" ?
>Thanks, Andrea !

Just scan the file, looking for a 0xFF byte which is immediately         
followed by a 0xC0 byte. The third byte after that is the number of      
bits (which should be 8). The next two bytes is the height of the image, 
a 16-bit word with the high-order byte first. The next two bytes is the  
width, again high-order byte first. The next byte is the number of colors
(usually 3 for a color image, 1 for monochrome).                         

If this whets your appetite for more, read the book _JPEG_ by Pennebaker
and Mitchell, which contains a copy of the JPEG standard.

ALso, if anyone is interested, I have C code for a JPEG dump utility
which runs under DOS (and maybe other systems).
-- 
Ron Boucher   [email-masked]