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?
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).
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
BTW, I also have a similar Java application in case you understand
that language better.
regards, tom lane
organizer, Independent JPEG Group
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