possible bug -draw polyline IM 6.4.2-8

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: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -draw polyline IM 6.4.2-8

Post by fmw42 »

IM 6.4.2-8 Q16 Mac OSX Tiger

I think I have found a bug in -draw with polyline (or any option that uses a set of points). It would appear that -draw gives a non-conforming drawing primitive error when a point is a fraction less than 1, because it does not have a leading 0, e.g. .5 vs 0.5

For example note the second point in the list:

points="0,0 .6,2.1 1.2,4.6 1.9,7.6 2.6,11.0 3.3,14.6 4.0,18.5 4.9,22.6 5.8,27.0 6.7,31.4 7.8,35.9 8.9,40.4 10.2,45.0 11.5,49.4 13.0,53.8 14.6,58.0 16.4,62.0 18.3,65.7 20.3,69.1 22.5,72.2 25.0,75.0 27.7,77.4 30.8,79.6 34.2,81.6 38.0,83.6 41.9,85.3 46.1,86.9 50.5,88.4 55.0,89.8 59.5,91.0 64.0,92.1 68.5,93.2 73.0,94.2 77.3,95.0 81.4,95.9 85.3,96.6 89.0,97.4 92.3,98.0 95.3,98.7 97.8,99.3 100,100"
convert -size 101x101 xc:white -fill white \
-draw "stroke red polyline $points" \
-flip test_interp_graph.gif
convert: Non-conforming drawing primitive definition `polyline'.

But if I repeat exactly the same but adding the leading 0:

points="0,0 0.6,2.1 1.2,4.6 1.9,7.6 2.6,11.0 3.3,14.6 4.0,18.5 4.9,22.6 5.8,27.0 6.7,31.4 7.8,35.9 8.9,40.4 10.2,45.0 11.5,49.4 13.0,53.8 14.6,58.0 16.4,62.0 18.3,65.7 20.3,69.1 22.5,72.2 25.0,75.0 27.7,77.4 30.8,79.6 34.2,81.6 38.0,83.6 41.9,85.3 46.1,86.9 50.5,88.4 55.0,89.8 59.5,91.0 64.0,92.1 68.5,93.2 73.0,94.2 77.3,95.0 81.4,95.9 85.3,96.6 89.0,97.4 92.3,98.0 95.3,98.7 97.8,99.3 100,100"
convert -size 101x101 xc:white -fill white \
-draw "stroke red polyline $points" \
-flip test_interp_graph.gif

It returns successfully.


P.S.

It does not fail if the the second member of the comma delimited pair has no leading zero, e.g. this works: 1.5,.5

Thus it appears that it does not like a leading period in any list item.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug -draw polyline IM 6.4.2-8

Post by magick »

The problem you reported is fixed in the current subversion trunk. Thanks for the problem report.
Post Reply