Page 1 of 1

Drawing a rectangle fails with de_DE locale

Posted: 2007-10-30T01:58:37-07:00
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'