The width and height of a JPEG image might seem irrelevant to the usual programmer, but at times a challenge comes up when it becomes required. During a small JPEG importing routine that I was writing I had to pass the width and height of the image as variables that were separate from the data itself. My first thought was that it would be stored in the header of the file just like GIF file width and height are stored, but it was no so.
Source Code
References
JPEG Header Information - a great summary of the header markers, it was just what I needed for this simple script
________________________________________
/ 'Cow says: Thank you for visiting. You \
| are browsing: Decoding the width and |
| height of a JPEG (JFIF) file. You have |
\ been to 1 pages on this site today.' /
----------------------------------------
\ ,__,
\ (oo)____
(__) )\
||--|| *