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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25256
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2018-12-19T16:57:18-07:00

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.

User avatar
fmw42
Posts: 25256
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2018-12-28T13:17:25-07:00

This is still an issue in IM 6.9.10.20 and IM 7.0.8.20

User avatar
magick
Site Admin
Posts: 11014
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2018-12-29T06:47:49-07:00

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.

User avatar
fmw42
Posts: 25256
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2018-12-29T10:59:14-07:00

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?

User avatar
magick
Site Admin
Posts: 11014
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2018-12-29T11:09:00-07:00

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.

User avatar
fmw42
Posts: 25256
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 » 2018-12-29T11:28:49-07:00

OK. Thanks

Post Reply