I have an image that i save with resolution and resolution unit like this:
Code: Select all
someImage.density(Geometry(resolution, resolution));
someImage.resolutionUnits(MagickCore::ResolutionType::PixelsPerCentimeterResolution);
someImage.write(imagePath);
Read code:
Code: Select all
Image someImage2;
someImage2.read(imagePath);
int resUnit2 = someImage2.resolutionUnits();
My OS Win 7 64 bit, using ImageMagick source compiled version 6.9.1-2.
Potential proposed fixed is here:
I debugged image magic, and the problem is during the retrieval of resolutionUnits from the image.
After i read the image, i call to return resolution units In Image.cpp this code gets executed
Code: Select all
Magick::ResolutionType Magick::Image::resolutionUnits(void) const
{
return(constOptions()->resolutionUnits());
}
This code should be updated to this:
Code: Select all
Magick::ResolutionType Magick::Image::resolutionUnits(void) const
{
return(constImage()->units());
}