Importing a PNG image with unittype field undefined fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
jazzynico |
Bug Description
The attached PNG image is imported with an incorrect resolution, due to a missing unit type field.
The command "identify -verbose IMG_5466.png" returns:
Image: IMG_5466.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 1136x640+0+0
Resolution: 72x72
Print size: 15.7778x8.88889
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
But the ImageMagick fallback in the Inkscape import code gives:
x_: 182.88
y_: 182.88
Note that the x_ and y_ values are due to the incorrect guess by our code that the unit type is in pixels by centimeter (182.88 = 72 * 2.54). Also note that 72 is the default resolution used by ImageMagick (independently of our code) when no unit type is set.
What should we do with such images?
1. Accept the default 72dpi value (and fix the invalid conversion on our side).
2. Mark the resolution as invalid and use the default Inkscape import resolution instead.
Related branches
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
(reproduced with r13266 and ImageMagick 6.8.8-10 on OS X 10.7.5)