Black line doesn't get drawn

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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Black line doesn't get drawn

Post by el_supremo »

[EDIT]
Version: ImageMagick 6.4.4 2008-10-09 Q8 http://www.imagemagick.org
on Win XP Pro SP3
[/EDIT]
The code below creates a white canvas, draws a circle and a rectangle on it and then writes the result.
Both the circle and rectangle have a fill defined to be red. If the stroke colour is anything except pure black then it is drawn around the perimeter of the square and circle. But if the stroke colour is pure black it isn't drawn.
A bug, or am I missing something?

Code: Select all

#include <windows.h>
#include <wand/magick_wand.h>

void test_wand(void)
{
	MagickWand *m_wand = NULL;
	DrawingWand *d_wand = NULL;
	PixelWand *c_wand = NULL;
	unsigned long radius,diameter;

	diameter = 640;
	radius = diameter/2;

	MagickWandGenesis();

	m_wand = NewMagickWand();
	d_wand = NewDrawingWand();
	c_wand = NewPixelWand();

	PixelSetColor(c_wand,"white");
	MagickNewImage(m_wand,diameter,diameter,c_wand);

	DrawSetStrokeOpacity(d_wand,1);

PushDrawingWand(d_wand);
	// This will draw the stroked outline but if
	// the stroke colour is changed to "black" or
	// "rgb(0,0,0)" it won't show in the final image  
	PixelSetColor(c_wand,"rgb(0,0,1)");

	DrawSetStrokeColor(d_wand,c_wand);
	DrawSetStrokeWidth(d_wand,4);
	DrawSetStrokeAntialias(d_wand,1);
	PixelSetColor(c_wand,"red");
	DrawSetFillColor(d_wand,c_wand);

	DrawCircle(d_wand,radius,radius,radius,radius*2);
	DrawRectangle(d_wand,50,13,120,87);
PopDrawingWand(d_wand);

	MagickDrawImage(m_wand,d_wand);
	MagickWriteImage(m_wand,"chart_test.jpg");

	c_wand = DestroyPixelWand(c_wand);
	m_wand = DestroyMagickWand(m_wand);
	d_wand = DestroyDrawingWand(d_wand);

	MagickWandTerminus();
}
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Black line doesn't get drawn

Post by magick »

We have an drawing optimization that causes the problem. We will have a patch in the ImageMagick Subversion trunk by tomorrow to repair the problem. Thanks.
Post Reply