Johnjces
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!
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!
The bitmap contains it :
http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/
You have information for Pixels per meter
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.
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.
hmmm... check this out: http://homepages.borland.com/efg2lab/Library/Delphi/Graphics/BMPPelsPerMeter.TXT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the information should be in the header. Take a look at this - for example JPG ...
http://www.fastgraph.com/help/jpeg_header_format.html