This project has moved and is read-only. For the latest updates, please go here.


Oct 29, 2014 at 2:30 PM
Edited Oct 29, 2014 at 2: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
Oct 29, 2014 at 4: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 3:27 AM
Edited Oct 30, 2014 at 3: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.

Oct 30, 2014 at 9: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.