Link to home
Start Free TrialLog in
Avatar of Johnjces
JohnjcesFlag for United States of America

asked on

How to obtain an images original size and resolution

Hello!

I have searched for info on obtaining the original picture resolution of a bmp, jpg, tif or whatever type image file and I have not been successful. I must be missing something!

What I would like to do is load a piture into a TImage (or similar) and obtain that picture's original dpi setting. From there I can get what I really want is the picture's original size in inches. Some pictures may be scanned at 300 dpi or a digital photo taken at 640 X 480 but have a resolution of 96 dpi or 150 dpi or whatever the user selected to scan or get the picture.

You know...

some apps can tell you that an image's original size is 5 inches X 7 inches with a dpi of 100 dpi, etc. Like MS Paint.
How can I do this?

Thanks for your help!
Avatar of Ivanov_G
Ivanov_G
Flag of Bulgaria image


   the information should be in the header. Take a look at this - for example JPG ...

   http://www.fastgraph.com/help/jpeg_header_format.html

   The bitmap contains it :

   http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/

   You have information for Pixels per meter
Avatar of Johnjces

ASKER

Thank-you! This what I have been seeking. I thought that such may be kept there but I am TERRIBLE when it comes to file manipulation and in obtaining this data.

Might you be so kind as to supply some smaple code on retrieving this info from a bmp and jpg? AGain, my coding skills in direct file manipulation and pasrsing is terrible.
Avatar of lopardo2003
lopardo2003

ASKER CERTIFIED SOLUTION
Avatar of Johnjces
Johnjces
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial