JPEG height and width numbers

JPEG height and width numbers

Post by Larr » Wed, 30 Aug 2000 15:19:31



I'm trying to write a program just to display to the user the height
and width of a JPEG file..... does any know where I can find
information on that?

Thanks

 
 
 

JPEG height and width numbers

Post by Marco Schmid » Wed, 30 Aug 2000 04:00:00



>I'm trying to write a program just to display to the user the height
>and width of a JPEG file..... does any know where I can find
>information on that?

A mimimum Pascal program to accomplish this task can be found at
http://www.geocities.com/~marcoschmidt/jpeginfo.zip (4 KB).

Regards,
Marco

 
 
 

JPEG height and width numbers

Post by Larr » Wed, 30 Aug 2000 04:00:00


Thanks Marco,

But I don't know Pascal, so it will be harder for me to look at the
source code, I was hoping for more of a file format document to show
me what each byte means..... again, thanks...

On Tue, 29 Aug 2000 13:30:52 +0200, Marco Schmidt



>>I'm trying to write a program just to display to the user the height
>>and width of a JPEG file..... does any know where I can find
>>information on that?

>A mimimum Pascal program to accomplish this task can be found at
>http://www.geocities.com/~marcoschmidt/jpeginfo.zip (4 KB).

>Regards,
>Marco

 
 
 

JPEG height and width numbers

Post by Marco Schmid » Wed, 30 Aug 2000 04:00:00



>But I don't know Pascal, so it will be harder for me to look at the
>source code, I was hoping for more of a file format document to show
>me what each byte means..... again, thanks...

At www.wotsit.org there are many file format descriptions. However,
Pascal (as a language developed for educational purposes) is quite
readable. Get the archive and mail me questions if you want to! I have
inserted enough comments to make it understandable (hopefully)...

The main thing to do for the program is to run in a loop, reading
markers (skipping their content) and waiting for a particular one to
appear.

BTW, I also have a similar Java application in case you understand
that language better.

Regards,
Marco

 
 
 

JPEG height and width numbers

Post by Tom Lan » Wed, 30 Aug 2000 04:00:00



> But I don't know Pascal, so it will be harder for me to look at the
> source code, I was hoping for more of a file format document to show
> me what each byte means..... again, thanks...

If you can't read Pascal, there's well-commented C code in rdjpgcom.c
in
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz or
ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6b.zip

                        regards, tom lane
                        organizer, Independent JPEG Group

 
 
 

1. reading JPEG height x width

Hi,

I'm having a problem reading the height and width from a JPG file.  (This is
VBScript, BTW).  Here's the code, found on a web site:

 s = Right(ts.Read(167), 4)
 Height = HexToDec(HexAt(s,1) & HexAt(s,2))
 Width= HexToDec(HexAt(s,3) & HexAt(s,4))

It reads bytes 164-167 (4 bytes total) from the file.  First two bytes are
converted to decimal and assigned to height.  The last two bytes are
converted to decimal and assigned to width.

The numbers always come up the same for every JPG, 5397, 4117, which isn't
even close.  Is this reading the proper bytes?  Is there something else
wrong?

Thanks,
Dan

2. SVGALib and Mesa and 3dfx

3. Pixel width and height of JPEG image?

4. HELP! AGFA Duoscan T1200 - very poor image quality...

5. calculate width, height of jpeg

6. Please help me !!!

7. JPEG Width and Heights in pixels

8. JPEG image width and height data info

9. Do JPEG images store height and width?

10. How to get JPEG height,width?

11. JPEG width and height help

12. Pixel width and height of JPEG image?