I am writing a simple(??) VB6 program to change a selected file's name. I want to show a small(appx scaled to a 2"X3" ) image of the picture. To avoid distortion of the image (I have to use a VB picture image) I want to alter the height and width of the displayed picture box to fit the size of the picture. To do this I want to extract the height and width of the file, then ratio it down and resize the picture boxes size
1 Answer
What fields in exif files provide image Height/Width information?
Here are the relevant Exif tags as defined in the Exif 2.3 standard (PDF Link):
+------------+------------+--------+-------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------+
| Tag (hex) | Tag (dec) | IFD | Key | Type | Tag description |
+------------+------------+--------+-------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------+
| 0x0100 | 256 | Image | Exif.Image.ImageWidth | Long | The number of columns of image data, equal to the number of pixels per row. In JPEG compressed data a JPEG marker is used instead of this tag. |
| 0x0101 | 257 | Image | Exif.Image.ImageLength | Long | The number of rows of image data. In JPEG compressed data a JPEG marker is used instead of this tag. |
+------------+------------+--------+-------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------+
Source Standard Exif Tags