Author Topic: Get DPI  (Read 1019 times)

Offline skar

  • Imaging User
  • *
  • Posts: 5
    • View Profile
Get DPI
« on: 9 June 2010, 10:50:06 »
how i can get the dpi of a image?

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 312
    • View Profile
    • Galfar's Homepage
Re: Get DPI
« Reply #1 on: 16 June 2010, 14:35:53 »
First you need the current sources from SVN repository.
Then you can use this code:
Code: [Select]
var
  XRes, YRes: Single;
begin
  ... load image
  if GlobalMetadata.GetPhysicalPixelSize(ruDpi, XRes, YRes) then
      ... do something with DPI info
 

If GetPhysicalPixelSize returns False that means no DPI info was present in the last loaded image. Also note that currently DPI info is read only from JPEG, PNG, and TIFF images.