Page 1 of 1

[RESOLVED]possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-14T13:50:08-07:00
by fmw42
Testing with IM 6.9.10.16 Q16 Mac OSX, I find that providing density and units for output to PNG is not working correctly. These issues go back at least as far as 6.9.8.10, which was as far back as I could go easily.

Input:
Image

Code: Select all

Image: 1.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 1000x1000+0+0
  Resolution: 39.37x39.37  <--- OK
  Print size: 25.4001x25.4001
  Units: PixelsPerCentimeter  <--- OK
  Colorspace: sRGB
  Type: PaletteAlpha
  Base type: Undefined
  Endianess: Undefined
  Depth: 8-bit

In the following, the result shows no density and units are undefined even though I supplied both.

convert 1.png -verbose -strip -resize 350x350 -quality 35 -units pixelsperinch -density 35x35 output-THDPI.png

Code: Select all

Image: output-THDPI.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 350x350+0+0
  Units: Undefined   <--- should be pixelsperinch and Resolution should be converted to those units, but no resolution shows.
  Colorspace: sRGB
  Type: PaletteAlpha
  Base type: Undefined
  Endianess: Undefined
  Depth: 8-bit

If I remove the strip, then I get Resolution and Units, but the density is not converted from pixelsperinch to pixelspercentimeter.

convert 1.png -verbose -resize 350x350 -quality 35 -units pixelsperinch -density 35x35 output-THDPI.png

Code: Select all

Image: output-THDPI.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 350x350+0+0
  Resolution: 35x35 <--- this density is wrong as it should be converted from pixelsperinch to pixelspercentimeter.
  Print size: 10x10
  Units: PixelsPerCentimeter  <---- correct units

Re: possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-15T11:10:52-07:00
by magick
The -strip option is respected by the PNG coder. To override, add -define png:include-chunk=pHYs to your command line.

Re: possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-15T12:13:35-07:00
by fmw42
magick wrote: 2018-12-15T11:10:52-07:00 The -strip option is respected by the PNG coder. To override, add -define png:include-chunk=pHYs to your command line.
OK. But that does not explain why the density is not converted in value when changing between units when -strip was removed.

See my second example above.

Fred

Re: possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-15T15:26:28-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-18T05:30:56-07:00
by mjamal
Is it updated yet with patch to fix this issue? I found below patch updated on Dec 17th.
ImageMagick-6.9.10-17.tar.bz2 2018-12-17 19:59 11M

Re: possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-18T05:34:29-07:00
by mjamal
Also, is this fixed for ImageMagick 6.7.8-9 2016-06-16 (for Linux dist)?

Re: possible bug with density/units IM 6.9.10.16 Q16

Posted: 2018-12-28T13:31:16-07:00
by fmw42
This bug seems to be resolved in IM 6.9.10.17.

Contact your Linux distributions about patching to include this bug. Imagemagick has no control over Linux patches.

Re: [RESOLVED]possible bug with density/units IM 6.9.10.16 Q16

Posted: 2019-01-07T04:37:58-07:00
by mjamal
Our Linux Admins are having hard time installing this new ImageMagick version 6.9.10 because of too many dependencies. We have spent around 3 days finding the dependencies but stuck finally. Can you please help us regarding the dependencies? Here are the details

1) Trying to install ImageMagic 6.9.10 from below link
https://www.imagemagick.org/download/li ... x86_64.rpm
It has below dependencies
a) Requires: ImageMagick-libs(x86-64) = 6.9.10-23
b) Requires: libMagickWand-6.Q16.so.6()(64bit)
c) Requires: libMagickCore-6.Q16.so.6()(64bit)

2) For the first from above list (a), it has below dependency
libopenjp2.so.7()(64bit)
We didn't find this rpm.
3) We couldn't locate RPM for libMagickWand-6.Q16.so.6()(64bit)
4) We couldn't locate RPM for libMagickCore-6.Q16.so.6()(64bit)

We have spent around 15 days for the main issue "Image Resize via DPI for PNG image". Fred clarified the issue to you and then you guys resolved it in new version 6.9.10. We tried to search every possible source for the RPMs but couldn't make it work. Please advise.

Re: [RESOLVED]possible bug with density/units IM 6.9.10.16 Q16

Posted: 2019-01-07T04:41:21-07:00
by mjamal
Just to add one more thing...
We are trying to install it on CentOS 7