Drawing a rectangle fails with de_DE locale

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
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Drawing a rectangle fails with de_DE locale

Post by mkoppanen »

Code: Select all

#include <stdio.h>
#include <string.h>
#include <wand/magick-wand.h>
#include <locale.h>
 
int main ()
{
	setlocale (LC_ALL, "de_DE");

	MagickWandGenesis();
	
	char *description;
	ExceptionType severity; 
	DrawingWand *draw_wand;
	MagickWand *magick_wand;
	PixelWand *color;

	draw_wand = NewDrawingWand();
	color = NewPixelWand();
	magick_wand = NewMagickWand();

	if( !MagickNewImage( magick_wand, 100, 100, color ) )
	{
		return 1;
	}
	
	DrawRectangle( draw_wand, 0, 0, 1, 1 );
	
	/* This call fails if locale is set to de_DE */
	if ( !MagickDrawImage( magick_wand, draw_wand ) )
	{
		description = MagickGetException(magick_wand,&severity); 
		
		(void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); 
		
		description = (char *)MagickRelinquishMemory(description); 
	}

	magick_wand = DestroyMagickWand( magick_wand );
	draw_wand = DestroyDrawingWand( draw_wand );
	color = DestroyPixelWand( color );

	MagickWandTerminus();
	return 0;
}
Expected result:

No output when executed.

Actual result:

wand.c unknown 34 Non-conforming drawing primitive definition `rectangle'
Mikko Koppanen
My blog: http://valokuva.org
Post Reply