From: Cristy Date: Mon, 28 May 2018 16:37:02 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-36~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=805d3ac9647e16e3980ede8cf91c2432ca8f91a9;p=imagemagick ... --- diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 7d5426f5e..0dad9ff6b 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -3130,6 +3130,16 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info, /* Class context. */ + for (p=q; *q != '\0'; ) + { + GetNextToken(q,&q,extent,token); + if (LocaleCompare(token,"pop") != 0) + continue; + GetNextToken(q,(const char **) NULL,extent,token); + if (LocaleCompare(token,"class") != 0) + continue; + break; + } GetNextToken(q,&q,extent,token); break; } diff --git a/coders/svg.c b/coders/svg.c index 9c924cbd0..ed9ecb349 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -2345,6 +2345,7 @@ static void SVGEndElement(void *context,const xmlChar *name) { if (LocaleCompare((const char *) name,"circle") == 0) { + (void) FormatLocaleFile(svg_info->file,"class \"circle\"\n"); (void) FormatLocaleFile(svg_info->file,"circle %g,%g %g,%g\n", svg_info->element.cx,svg_info->element.cy,svg_info->element.cx, svg_info->element.cy+svg_info->element.minor); @@ -2394,6 +2395,7 @@ static void SVGEndElement(void *context,const xmlChar *name) double angle; + (void) FormatLocaleFile(svg_info->file,"class \"ellipse\"\n"); angle=svg_info->element.angle; (void) FormatLocaleFile(svg_info->file,"ellipse %g,%g %g,%g 0,360\n", svg_info->element.cx,svg_info->element.cy, @@ -2443,6 +2445,7 @@ static void SVGEndElement(void *context,const xmlChar *name) { if (LocaleCompare((const char *) name,"line") == 0) { + (void) FormatLocaleFile(svg_info->file,"class \"line\"\n"); (void) FormatLocaleFile(svg_info->file,"line %g,%g %g,%g\n", svg_info->segment.x1,svg_info->segment.y1,svg_info->segment.x2, svg_info->segment.y2); @@ -2476,6 +2479,7 @@ static void SVGEndElement(void *context,const xmlChar *name) } if (LocaleCompare((const char *) name,"path") == 0) { + (void) FormatLocaleFile(svg_info->file,"class \"polygon\"\n"); (void) FormatLocaleFile(svg_info->file,"path \"%s\"\n", svg_info->vertices); (void) FormatLocaleFile(svg_info->file,"pop graphic-context\n"); @@ -2483,6 +2487,7 @@ static void SVGEndElement(void *context,const xmlChar *name) } if (LocaleCompare((const char *) name,"polygon") == 0) { + (void) FormatLocaleFile(svg_info->file,"class \"polygon\"\n"); (void) FormatLocaleFile(svg_info->file,"polygon %s\n", svg_info->vertices); (void) FormatLocaleFile(svg_info->file,"pop graphic-context\n"); @@ -2490,6 +2495,7 @@ static void SVGEndElement(void *context,const xmlChar *name) } if (LocaleCompare((const char *) name,"polyline") == 0) { + (void) FormatLocaleFile(svg_info->file,"class \"polyline\"\n"); (void) FormatLocaleFile(svg_info->file,"polyline %s\n", svg_info->vertices); (void) FormatLocaleFile(svg_info->file,"pop graphic-context\n"); @@ -2509,6 +2515,7 @@ static void SVGEndElement(void *context,const xmlChar *name) { if ((svg_info->radius.x == 0.0) && (svg_info->radius.y == 0.0)) { + (void) FormatLocaleFile(svg_info->file,"class \"rect\"\n"); (void) FormatLocaleFile(svg_info->file,"rectangle %g,%g %g,%g\n", svg_info->bounds.x,svg_info->bounds.y, svg_info->bounds.x+svg_info->bounds.width, @@ -2595,6 +2602,7 @@ static void SVGEndElement(void *context,const xmlChar *name) char *text; + (void) FormatLocaleFile(svg_info->file,"class \"text\"\n"); text=EscapeString(svg_info->text,'\''); (void) FormatLocaleFile(svg_info->file,"text 0,0 \"%s\"\n",text); text=DestroyString(text);