This project has moved. For the latest updates, please go here.

ResolutionUnit

Oct 29, 2014 at 1:30 PM
Edited Oct 29, 2014 at 1:54 PM
How do I get the ResolutionUnits of an image?

It is missing in MagickImageInfo().
If I use MagickImage().ResolutionUnits, the result is "Undefined".

The image I tried has that info, using:
  • photoshop
  • "identify.exe -verbose [image]" utility from ImageMagick
thanks,
Coordinator
Oct 29, 2014 at 3:32 PM
Can you post a link to the image you are using on something like DropBox? Feel free to contact me trough CodePlex if you don't want to publicly share your image.
Oct 30, 2014 at 2:27 AM
Edited Oct 30, 2014 at 2:29 AM
Sample 1
Sample 2
(Note: it's just a blank image for testing)

Can you please implement ResolutionUnits in MagickImageInfo?
And a hook to identify.exe's format function if it is readily available in ImageMagick already.
It would be tedious to implement each possible info, so just let the user get what they need.

My goal is to get the physical dimension of an image using:
Physical Width = MagickImageInfo's.Width / MagickImageInfo's.ResolutionX
but I can't tell if its inches or cm.

Thanks
Coordinator
Oct 30, 2014 at 8:27 PM
I have added ResolutionUnits to MagickImageInfo. And you found a bug in MagickImage.ResolutionUnits. It returns an invalid value, this will be fixed in the next release of Magick.NET.

The format function of identify.exe is already available under the name MagickImage.FormatExpression. You could use that for now to get the correct ResolutionUnits.