Page 1 of 1

[RESOLVED]discrepancy in verbose information converting SVG to PNG and JPG IM 6.9.10.17 Q16 Mac OSX

Posted: 2018-12-19T16:57:18-07:00
by fmw42
convert -units PixelsPerCentimeter -density 37.8 MSVG:wizard.svg tmp1.png
Image: tmp1.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: DirectClass
Geometry: 370x492+0+0
Resolution: 37.8x37.8
Print size: 9.78836x13.0159
Units: PixelsPerCentimeter



convert -units PixelsPerCentimeter -density 37.8 MSVG:wizard.svg tmp1.jpg
Image: tmp1.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 370x492+0+0
Resolution: 37x37
Print size: 10x13.2973
Units: PixelsPerCentimeter


Looks like for JPG, the Resolution is being truncated and this affects the print size.

Re: discrepancy in verbose information converting SVG to PNG and JPG IM 6.9.10.17 Q16 Mac OSX

Posted: 2018-12-28T13:17:25-07:00
by fmw42
This is still an issue in IM 6.9.10.20 and IM 7.0.8.20

Re: discrepancy in verbose information converting SVG to PNG and JPG IM 6.9.10.17 Q16 Mac OSX

Posted: 2018-12-29T06:47:49-07:00
by magick
The JFIF resolution marker is integer. To get a fractional resolution you must include an EXIF profile that includes the resolution field. ImageMagick detects this and updates the resolution field with the fractional resolution.

Re: discrepancy in verbose information converting SVG to PNG and JPG IM 6.9.10.17 Q16 Mac OSX

Posted: 2018-12-29T10:59:14-07:00
by fmw42
Sorry, I do not understand. When I set the resolution to a fractional value, why does it not adjust the JFIF marker to permit the fractional value?

Re: discrepancy in verbose information converting SVG to PNG and JPG IM 6.9.10.17 Q16 Mac OSX

Posted: 2018-12-29T11:09:00-07:00
by magick
The JFIF marker only supports 2-byte integer values. EXIF uses 4-byte integers (its divided by 65536) permitting fractional values. See the JFIF format specification.

Re: discrepancy in verbose information converting SVG to PNG and JPG IM 6.9.10.17 Q16 Mac OSX

Posted: 2018-12-29T11:28:49-07:00
by fmw42
OK. Thanks