mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-25 11:24:54 +02:00
Check to ensure token does not exceed maximum extent
This commit is contained in:
@@ -577,9 +577,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
p=(const char *) content;
|
||||
for (i=0; (*p != '\0') && (i < 3); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -609,9 +609,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
p=(const char *) content;
|
||||
for (i=0; (*p != '\0') && (i < 3); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -642,9 +642,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
p=(const char *) content;
|
||||
for (i=0; (*p != '\0') && (i < 3); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -679,7 +679,7 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
{
|
||||
content=GetXMLTreeContent(saturation);
|
||||
p=(const char *) content;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
color_correction.saturation=StringToDouble(token,(char **) NULL);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -243,7 +243,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
|
||||
channel_mask=UndefinedChannel;
|
||||
pixel=0.0;
|
||||
p=(char *) expression;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
channel_op=ExtractChannelOp;
|
||||
for (channels=0; *token != '\0'; )
|
||||
{
|
||||
@@ -257,7 +257,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
|
||||
{
|
||||
case ',':
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
case '|':
|
||||
@@ -266,7 +266,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
|
||||
source_image=GetNextImageInList(source_image);
|
||||
else
|
||||
source_image=GetFirstImageInList(source_image);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
case ';':
|
||||
@@ -291,7 +291,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
|
||||
}
|
||||
AppendImageToList(&destination_image,canvas);
|
||||
destination_image=GetLastImageInList(destination_image);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
channels=0;
|
||||
destination_channel=RedPixelChannel;
|
||||
channel_mask=UndefinedChannel;
|
||||
@@ -310,30 +310,30 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
|
||||
}
|
||||
source_channel=(PixelChannel) i;
|
||||
channel_op=ExtractChannelOp;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == '<')
|
||||
{
|
||||
channel_op=ExchangeChannelOp;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
if (*token == '=')
|
||||
{
|
||||
if (channel_op != ExchangeChannelOp)
|
||||
channel_op=AssignChannelOp;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
if (*token == '>')
|
||||
{
|
||||
if (channel_op != ExchangeChannelOp)
|
||||
channel_op=TransferChannelOp;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
switch (channel_op)
|
||||
{
|
||||
case AssignChannelOp:
|
||||
{
|
||||
pixel=StringToDoubleInterval(token,(double) QuantumRange+1.0);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
case ExchangeChannelOp:
|
||||
@@ -383,7 +383,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
|
||||
if (((channels >= 1) || (destination_channel >= 1)) &&
|
||||
(IsGrayColorspace(destination_image->colorspace) != MagickFalse))
|
||||
(void) SetImageColorspace(destination_image,sRGBColorspace,exception);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
+8
-8
@@ -834,7 +834,7 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -844,7 +844,7 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -853,7 +853,7 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -864,10 +864,10 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -926,11 +926,11 @@ static MagickBooleanType LoadCoderCache(SplayTreeInfo *coder_cache,
|
||||
coder_info=(CoderInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'M':
|
||||
|
||||
+8
-8
@@ -2008,7 +2008,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -2018,7 +2018,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -2027,7 +2027,7 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -2038,10 +2038,10 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -2099,11 +2099,11 @@ static MagickBooleanType LoadColorCache(LinkedListInfo *color_cache,
|
||||
color_info=(ColorInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'C':
|
||||
|
||||
@@ -895,7 +895,7 @@ MagickExport LinkedListInfo *GetConfigurePaths(const char *filename,
|
||||
/*
|
||||
Search $XDG_CONFIG_HOME/ImageMagick.
|
||||
*/
|
||||
(void) FormatLocaleString(path,MaxTextExtent,"%s%sImageMagick%s",
|
||||
(void) FormatLocaleString(path,MagickPathExtent,"%s%sImageMagick%s",
|
||||
home,DirectorySeparator,DirectorySeparator);
|
||||
(void) AppendValueToLinkedList(paths,ConstantString(path));
|
||||
home=DestroyString(home);
|
||||
@@ -1165,7 +1165,7 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -1175,7 +1175,7 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -1184,7 +1184,7 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -1195,10 +1195,10 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -1260,11 +1260,11 @@ static MagickBooleanType LoadConfigureCache(LinkedListInfo *configure_cache,
|
||||
/*
|
||||
Parse configure element.
|
||||
*/
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'N':
|
||||
|
||||
@@ -1519,7 +1519,7 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -1529,7 +1529,7 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -1538,7 +1538,7 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -1549,10 +1549,10 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -1611,11 +1611,11 @@ static MagickBooleanType LoadDelegateCache(LinkedListInfo *delegate_cache,
|
||||
delegate_info=(DelegateInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'C':
|
||||
|
||||
+156
-156
@@ -1792,7 +1792,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
/*
|
||||
Interpret graphic primitive.
|
||||
*/
|
||||
GetMagickToken(q,&q,keyword);
|
||||
GetMagickToken(q,&q,MagickPathExtent,keyword);
|
||||
if (*keyword == '\0')
|
||||
break;
|
||||
if (*keyword == '#')
|
||||
@@ -1817,27 +1817,27 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("affine",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.rx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.ry=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sy=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.tx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.ty=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -1864,7 +1864,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("border-color",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) QueryColorCompliance(token,AllCompliance,
|
||||
&graphic_context[n]->border_color,exception);
|
||||
break;
|
||||
@@ -1880,7 +1880,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
/*
|
||||
Create clip mask.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CloneString(&graphic_context[n]->clip_mask,token);
|
||||
(void) DrawClipPath(image,graphic_context[n],
|
||||
graphic_context[n]->clip_mask,exception);
|
||||
@@ -1891,7 +1891,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
fill_rule;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
fill_rule=ParseCommandOption(MagickFillRuleOptions,MagickFalse,
|
||||
token);
|
||||
if (fill_rule == -1)
|
||||
@@ -1905,7 +1905,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
clip_units;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
clip_units=ParseCommandOption(MagickClipPathOptions,MagickFalse,
|
||||
token);
|
||||
if (clip_units == -1)
|
||||
@@ -1946,7 +1946,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
decorate;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
decorate=ParseCommandOption(MagickDecorateOptions,MagickFalse,
|
||||
token);
|
||||
if (decorate == -1)
|
||||
@@ -1957,7 +1957,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("density",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CloneString(&graphic_context[n]->density,token);
|
||||
break;
|
||||
}
|
||||
@@ -1966,7 +1966,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
direction;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
direction=ParseCommandOption(MagickDirectionOptions,MagickFalse,
|
||||
token);
|
||||
if (direction == -1)
|
||||
@@ -1988,7 +1988,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("encoding",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CloneString(&graphic_context[n]->encoding,token);
|
||||
break;
|
||||
}
|
||||
@@ -2000,7 +2000,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("fill",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(pattern,MagickPathExtent,"%s",token);
|
||||
if (GetImageArtifact(image,pattern) != (const char *) NULL)
|
||||
(void) DrawPatternPath(image,draw_info,token,
|
||||
@@ -2027,7 +2027,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("fill-opacity",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
|
||||
graphic_context[n]->fill.alpha=(double) QuantumRange*
|
||||
factor*StringToDouble(token,(char **) NULL);
|
||||
@@ -2038,7 +2038,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
fill_rule;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
fill_rule=ParseCommandOption(MagickFillRuleOptions,MagickFalse,
|
||||
token);
|
||||
if (fill_rule == -1)
|
||||
@@ -2049,7 +2049,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("font",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CloneString(&graphic_context[n]->font,token);
|
||||
if (LocaleCompare("none",token) == 0)
|
||||
graphic_context[n]->font=(char *)
|
||||
@@ -2058,13 +2058,13 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("font-family",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CloneString(&graphic_context[n]->family,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("font-size",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->pointsize=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -2073,7 +2073,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
stretch;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
stretch=ParseCommandOption(MagickStretchOptions,MagickFalse,token);
|
||||
if (stretch == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2086,7 +2086,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
style;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
style=ParseCommandOption(MagickStyleOptions,MagickFalse,token);
|
||||
if (style == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2099,7 +2099,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
weight;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
weight=ParseCommandOption(MagickWeightOptions,MagickFalse,
|
||||
token);
|
||||
if (weight == -1)
|
||||
@@ -2115,7 +2115,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("gradient-units",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("gravity",keyword) == 0)
|
||||
@@ -2123,7 +2123,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
gravity;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,token);
|
||||
if (gravity == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2143,7 +2143,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
compose;
|
||||
|
||||
primitive_type=ImagePrimitive;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
compose=ParseCommandOption(MagickComposeOptions,MagickFalse,token);
|
||||
if (compose == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2153,14 +2153,14 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("interline-spacing",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->interline_spacing=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("interword-spacing",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->interword_spacing=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
break;
|
||||
@@ -2173,7 +2173,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("kerning",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->kerning=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -2194,12 +2194,12 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("offset",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("opacity",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
|
||||
graphic_context[n]->alpha=ClampToQuantum(QuantumRange*(1.0-((1.0-
|
||||
QuantumScale*graphic_context[n]->alpha)*factor*
|
||||
@@ -2236,7 +2236,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("pop",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare("clip-path",token) == 0)
|
||||
break;
|
||||
if (LocaleCompare("defs",token) == 0)
|
||||
@@ -2268,27 +2268,27 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("push",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare("clip-path",token) == 0)
|
||||
{
|
||||
char
|
||||
name[MagickPathExtent];
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(name,MagickPathExtent,"%s",token);
|
||||
for (p=q; *q != '\0'; )
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(token,"pop") != 0)
|
||||
continue;
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (LocaleCompare(token,"clip-path") != 0)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
(void) CopyMagickString(token,p,(size_t) (q-p-4+1));
|
||||
(void) SetImageArtifact(image,name,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("gradient",token) == 0)
|
||||
@@ -2301,36 +2301,36 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
SegmentInfo
|
||||
segment;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(name,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(type,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
segment.x1=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
segment.y1=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
segment.x2=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
segment.y2=StringToDouble(token,(char **) NULL);
|
||||
if (LocaleCompare(type,"radial") == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
}
|
||||
for (p=q; *q != '\0'; )
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(token,"pop") != 0)
|
||||
continue;
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (LocaleCompare(token,"gradient") != 0)
|
||||
continue;
|
||||
break;
|
||||
@@ -2359,7 +2359,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
MagickMax(fabs(bounds.y2-bounds.y1+1.0),1.0),
|
||||
bounds.x1,bounds.y1);
|
||||
(void) SetImageArtifact(image,key,geometry);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("pattern",token) == 0)
|
||||
@@ -2371,32 +2371,32 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
RectangleInfo
|
||||
pattern_bounds;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(name,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
pattern_bounds.x=(ssize_t) ceil(StringToDouble(token,
|
||||
(char **) NULL)-0.5);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
pattern_bounds.y=(ssize_t) ceil(StringToDouble(token,
|
||||
(char **) NULL)-0.5);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
pattern_bounds.width=(size_t) floor(StringToDouble(token,
|
||||
(char **) NULL)+0.5);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
pattern_bounds.height=(size_t) floor(StringToDouble(token,
|
||||
(char **) NULL)+0.5);
|
||||
for (p=q; *q != '\0'; )
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(token,"pop") != 0)
|
||||
continue;
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (LocaleCompare(token,"pattern") != 0)
|
||||
continue;
|
||||
break;
|
||||
@@ -2411,7 +2411,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
(double)pattern_bounds.height,(double)pattern_bounds.x,
|
||||
(double)pattern_bounds.y);
|
||||
(void) SetImageArtifact(image,key,geometry);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("graphic-context",token) == 0)
|
||||
@@ -2448,7 +2448,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("rotate",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
angle=StringToDouble(token,(char **) NULL);
|
||||
affine.sx=cos(DegreesToRadians(fmod((double) angle,360.0)));
|
||||
affine.rx=sin(DegreesToRadians(fmod((double) angle,360.0)));
|
||||
@@ -2469,24 +2469,24 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("scale",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sy=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("skewX",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
angle=StringToDouble(token,(char **) NULL);
|
||||
affine.ry=sin(DegreesToRadians(angle));
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("skewY",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
angle=StringToDouble(token,(char **) NULL);
|
||||
affine.rx=(-tan(DegreesToRadians(angle)/2.0));
|
||||
break;
|
||||
@@ -2509,17 +2509,17 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
image->filename);
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) QueryColorCompliance(token,AllCompliance,&stop_color,
|
||||
exception);
|
||||
stops[number_stops-1].color=stop_color;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
stops[number_stops-1].offset=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("stroke",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(pattern,MagickPathExtent,"%s",token);
|
||||
if (GetImageArtifact(image,pattern) != (const char *) NULL)
|
||||
(void) DrawPatternPath(image,draw_info,token,
|
||||
@@ -2546,7 +2546,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("stroke-antialias",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->stroke_antialias=
|
||||
StringToLong(token) != 0 ? MagickTrue : MagickFalse;
|
||||
break;
|
||||
@@ -2562,14 +2562,14 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
*r;
|
||||
|
||||
r=q;
|
||||
GetMagickToken(r,&r,token);
|
||||
GetMagickToken(r,&r,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(r,&r,token);
|
||||
GetMagickToken(r,&r,MagickPathExtent,token);
|
||||
for (x=0; IsPoint(token) != MagickFalse; x++)
|
||||
{
|
||||
GetMagickToken(r,&r,token);
|
||||
GetMagickToken(r,&r,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(r,&r,token);
|
||||
GetMagickToken(r,&r,MagickPathExtent,token);
|
||||
}
|
||||
graphic_context[n]->dash_pattern=(double *)
|
||||
AcquireQuantumMemory((size_t) (2UL*x+1UL),
|
||||
@@ -2583,9 +2583,9 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
for (j=0; j < x; j++)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->dash_pattern[j]=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
}
|
||||
@@ -2596,12 +2596,12 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
graphic_context[n]->dash_pattern[j]=0.0;
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("stroke-dashoffset",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->dash_offset=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
break;
|
||||
@@ -2611,7 +2611,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
linecap;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
linecap=ParseCommandOption(MagickLineCapOptions,MagickFalse,token);
|
||||
if (linecap == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2624,7 +2624,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
linejoin;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
linejoin=ParseCommandOption(MagickLineJoinOptions,MagickFalse,
|
||||
token);
|
||||
if (linejoin == -1)
|
||||
@@ -2635,13 +2635,13 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("stroke-miterlimit",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->miterlimit=StringToUnsignedLong(token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("stroke-opacity",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
factor=strchr(token,'%') != (char *) NULL ? 0.01 : 1.0;
|
||||
graphic_context[n]->stroke.alpha=(double) QuantumRange*
|
||||
factor*StringToDouble(token,(char **) NULL);
|
||||
@@ -2649,7 +2649,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("stroke-width",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->stroke_width=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
break;
|
||||
@@ -2670,7 +2670,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
align;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
align=ParseCommandOption(MagickAlignOptions,MagickFalse,token);
|
||||
if (align == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2683,7 +2683,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
ssize_t
|
||||
align;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
align=ParseCommandOption(MagickAlignOptions,MagickFalse,token);
|
||||
if (align == -1)
|
||||
status=MagickFalse;
|
||||
@@ -2693,25 +2693,25 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
}
|
||||
if (LocaleCompare("text-antialias",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->text_antialias=
|
||||
StringToLong(token) != 0 ? MagickTrue : MagickFalse;
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("text-undercolor",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) QueryColorCompliance(token,AllCompliance,
|
||||
&graphic_context[n]->undercolor,exception);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("translate",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.tx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.ty=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -2723,22 +2723,22 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
{
|
||||
if (LocaleCompare("viewbox",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->viewbox.x=(ssize_t) ceil(StringToDouble(token,
|
||||
(char **) NULL)-0.5);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->viewbox.y=(ssize_t) ceil(StringToDouble(token,
|
||||
(char **) NULL)-0.5);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->viewbox.width=(size_t) floor(StringToDouble(
|
||||
token,(char **) NULL)+0.5);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
graphic_context[n]->viewbox.height=(size_t) floor(StringToDouble(
|
||||
token,(char **) NULL)+0.5);
|
||||
break;
|
||||
@@ -2803,15 +2803,15 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
*/
|
||||
if (IsPoint(q) == MagickFalse)
|
||||
break;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
point.x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
point.y=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
primitive_info[i].primitive=primitive_type;
|
||||
primitive_info[i].point=point;
|
||||
primitive_info[i].coordinates=0;
|
||||
@@ -2891,7 +2891,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
*s,
|
||||
*t;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
length=1;
|
||||
t=token;
|
||||
for (s=token; *s != '\0'; s=t)
|
||||
@@ -3068,7 +3068,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
status=MagickFalse;
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
method=ParseCommandOption(MagickMethodOptions,MagickFalse,token);
|
||||
if (method == -1)
|
||||
status=MagickFalse;
|
||||
@@ -3084,7 +3084,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
break;
|
||||
}
|
||||
if (*token != ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
primitive_info[j].text=AcquireString(token);
|
||||
break;
|
||||
}
|
||||
@@ -3095,7 +3095,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info,
|
||||
status=MagickFalse;
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
primitive_info[j].text=AcquireString(token);
|
||||
break;
|
||||
}
|
||||
@@ -5387,33 +5387,33 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
*/
|
||||
do
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
arc.x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
arc.y=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
angle=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
large_arc=StringToLong(token) != 0 ? MagickTrue : MagickFalse;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
sweep=StringToLong(token) != 0 ? MagickTrue : MagickFalse;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
end.x=(double) (attribute == (int) 'A' ? x : point.x+x);
|
||||
end.y=(double) (attribute == (int) 'A' ? y : point.y+y);
|
||||
@@ -5438,13 +5438,13 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
points[0]=point;
|
||||
for (i=1; i < 4; i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
end.x=(double) (attribute == (int) 'C' ? x : point.x+x);
|
||||
end.y=(double) (attribute == (int) 'C' ? y : point.y+y);
|
||||
@@ -5463,9 +5463,9 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
{
|
||||
do
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
point.x=(double) (attribute == (int) 'H' ? x: point.x+x);
|
||||
TracePoint(q,point);
|
||||
@@ -5478,13 +5478,13 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
{
|
||||
do
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
point.x=(double) (attribute == (int) 'L' ? x : point.x+x);
|
||||
point.y=(double) (attribute == (int) 'L' ? y : point.y+y);
|
||||
@@ -5505,13 +5505,13 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
i=0;
|
||||
do
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
point.x=(double) (attribute == (int) 'M' ? x : point.x+x);
|
||||
point.y=(double) (attribute == (int) 'M' ? y : point.y+y);
|
||||
@@ -5539,13 +5539,13 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
points[0]=point;
|
||||
for (i=1; i < 3; i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
if (*p == ',')
|
||||
p++;
|
||||
@@ -5574,13 +5574,13 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
points[1].y=2.0*points[3].y-points[2].y;
|
||||
for (i=2; i < 4; i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
if (*p == ',')
|
||||
p++;
|
||||
@@ -5614,13 +5614,13 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
points[1].y=2.0*points[2].y-points[1].y;
|
||||
for (i=2; i < 3; i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
end.x=(double) (attribute == (int) 'T' ? x : point.x+x);
|
||||
end.y=(double) (attribute == (int) 'T' ? y : point.y+y);
|
||||
@@ -5644,9 +5644,9 @@ static size_t TracePath(PrimitiveInfo *primitive_info,const char *path)
|
||||
{
|
||||
do
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
point.y=(double) (attribute == (int) 'V' ? y : point.y+y);
|
||||
TracePoint(q,point);
|
||||
|
||||
@@ -577,9 +577,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
p=(const char *) content;
|
||||
for (i=0; (*p != '\0') && (i < 3); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -609,9 +609,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
p=(const char *) content;
|
||||
for (i=0; (*p != '\0') && (i < 3); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -642,9 +642,9 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
p=(const char *) content;
|
||||
for (i=0; (*p != '\0') && (i < 3); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -679,7 +679,7 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
|
||||
{
|
||||
content=GetXMLTreeContent(saturation);
|
||||
p=(const char *) content;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
color_correction.saturation=StringToDouble(token,(char **) NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,9 +729,9 @@ MagickExport MagickStatusType ParseAffineGeometry(const char *geometry,
|
||||
p=(char *) geometry;
|
||||
for (i=0; (*p != '\0') && (i < 6); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
@@ -864,7 +864,7 @@ MagickExport MagickStatusType ParseGeometry(const char *geometry,
|
||||
c=(int) ((unsigned char) *p);
|
||||
if (isspace(c) != 0)
|
||||
{
|
||||
(void) CopyMagickString(p,p+1,MaxTextExtent);
|
||||
(void) CopyMagickString(p,p+1,MagickPathExtent);
|
||||
continue;
|
||||
}
|
||||
switch (c)
|
||||
|
||||
+10
-10
@@ -1193,7 +1193,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickLocaleExtent);
|
||||
@@ -1204,7 +1204,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
while (isspace((int) ((unsigned char) *q)) != 0)
|
||||
q++;
|
||||
}
|
||||
@@ -1217,7 +1217,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
while (isspace((int) ((unsigned char) *q)) != 0)
|
||||
q++;
|
||||
}
|
||||
@@ -1231,10 +1231,10 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickLocaleExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"locale") == 0)
|
||||
{
|
||||
if (LocaleCompare(locale,token) != 0)
|
||||
@@ -1281,10 +1281,10 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
while ((*token != '>') && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickLocaleExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -1306,10 +1306,10 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
while ((*token != '>') && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickLocaleExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"name") == 0)
|
||||
{
|
||||
(void) ConcatenateMagickString(tag,token,MagickLocaleExtent);
|
||||
@@ -1368,7 +1368,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *locale_cache,
|
||||
(void) ConcatenateMagickString(tag,"/",MagickLocaleExtent);
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
}
|
||||
|
||||
+8
-8
@@ -1448,7 +1448,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -1458,7 +1458,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -1467,7 +1467,7 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -1478,10 +1478,10 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -1538,11 +1538,11 @@ static MagickBooleanType LoadLogCache(LinkedListInfo *log_cache,const char *xml,
|
||||
log_info=(LogInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'E':
|
||||
|
||||
+8
-8
@@ -855,7 +855,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -865,7 +865,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -874,7 +874,7 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -885,10 +885,10 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -947,11 +947,11 @@ static MagickBooleanType LoadMagicCache(LinkedListInfo *magic_cache,
|
||||
magic_info=(MagicInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'N':
|
||||
|
||||
+1
-1
@@ -792,7 +792,7 @@ static MagickBooleanType GetMagickModulePath(const char *filename,
|
||||
/*
|
||||
Search $XDG_CONFIG_HOME/ImageMagick.
|
||||
*/
|
||||
(void) FormatLocaleString(path,MaxTextExtent,"%s%sImageMagick%s%s",
|
||||
(void) FormatLocaleString(path,MagickPathExtent,"%s%sImageMagick%s%s",
|
||||
home,DirectorySeparator,DirectorySeparator,filename);
|
||||
home=DestroyString(home);
|
||||
if (IsPathAccessible(path) != MagickFalse)
|
||||
|
||||
@@ -298,9 +298,9 @@ static KernelInfo *ParseKernelArray(const char *kernel_string)
|
||||
p++; /* ignore "'" chars for convolve filter usage - Cristy */
|
||||
for (i=0; p < end; i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
/* set the size of the kernel - old sized square */
|
||||
kernel->width = kernel->height= (size_t) sqrt((double) i+1.0);
|
||||
@@ -320,9 +320,9 @@ static KernelInfo *ParseKernelArray(const char *kernel_string)
|
||||
kernel->negative_range = kernel->positive_range = 0.0;
|
||||
for (i=0; (i < (ssize_t) (kernel->width*kernel->height)) && (p < end); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( LocaleCompare("nan",token) == 0
|
||||
|| LocaleCompare("-",token) == 0 ) {
|
||||
kernel->values[i] = nan; /* this value is not part of neighbourhood */
|
||||
@@ -338,7 +338,7 @@ static KernelInfo *ParseKernelArray(const char *kernel_string)
|
||||
}
|
||||
|
||||
/* sanity check -- no more values in kernel definition */
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( *token != '\0' && *token != ';' && *token != '\'' )
|
||||
return(DestroyKernelInfo(kernel));
|
||||
|
||||
@@ -393,7 +393,7 @@ static KernelInfo *ParseKernelName(const char *kernel_string,
|
||||
type;
|
||||
|
||||
/* Parse special 'named' kernel */
|
||||
GetMagickToken(kernel_string,&p,token);
|
||||
GetMagickToken(kernel_string,&p,MagickPathExtent,token);
|
||||
type=ParseCommandOption(MagickKernelOptions,MagickFalse,token);
|
||||
if ( type < 0 || type == UserDefinedKernel )
|
||||
return((KernelInfo *) NULL); /* not a valid named kernel */
|
||||
@@ -509,7 +509,7 @@ MagickExport KernelInfo *AcquireKernelInfo(const char *kernel_string,
|
||||
p=(const char *) kernel_cache;
|
||||
}
|
||||
kernel=NULL;
|
||||
while (GetMagickToken(p,NULL,token), *token != '\0')
|
||||
while (GetMagickToken(p,(const char **) NULL,MagickPathExtent,token), *token != '\0')
|
||||
{
|
||||
/* ignore extra or multiple ';' kernel separators */
|
||||
if (*token != ';')
|
||||
|
||||
+1
-1
@@ -2758,7 +2758,7 @@ MagickExport ssize_t ParsePixelChannelOption(const char *channels)
|
||||
ssize_t
|
||||
channel;
|
||||
|
||||
GetMagickToken(channels,NULL,token);
|
||||
GetMagickToken(channels,(const char **) NULL,MagickPathExtent,token);
|
||||
if ((*token == ';') || (*token == '|'))
|
||||
return(RedPixelChannel);
|
||||
channel=ParseCommandOption(MagickPixelChannelOptions,MagickTrue,token);
|
||||
|
||||
+8
-8
@@ -763,7 +763,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -773,7 +773,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
|
||||
Docdomain element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -782,7 +782,7 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -793,10 +793,10 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -854,11 +854,11 @@ static MagickBooleanType LoadPolicyCache(LinkedListInfo *policy_cache,
|
||||
policy_info=(PolicyInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'D':
|
||||
|
||||
@@ -1346,9 +1346,9 @@ MagickExport MagickBooleanType OrderedDitherImage(Image *image,
|
||||
if ((p != (char *) NULL) && (isdigit((int) ((unsigned char) *(++p))) != 0))
|
||||
for (i=0; (*p != '\0') && (i < MaxPixelChannels); i++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
levels[i]=StringToDouble(token,(char **) NULL);
|
||||
}
|
||||
for (i=0; i < MaxPixelChannels; i++)
|
||||
|
||||
+21
-11
@@ -163,10 +163,13 @@ MagickExport TokenInfo *DestroyTokenInfo(TokenInfo *token_info)
|
||||
%
|
||||
% o end: point to the end of the token sequence.
|
||||
%
|
||||
% o extent: maximum extent of the token.
|
||||
%
|
||||
% o token: copy the token to this buffer.
|
||||
%
|
||||
*/
|
||||
MagickExport void GetMagickToken(const char *start,const char **end,char *token)
|
||||
MagickExport void GetMagickToken(const char *start,const char **end,
|
||||
const size_t extent,char *token)
|
||||
{
|
||||
double
|
||||
value;
|
||||
@@ -213,15 +216,18 @@ MagickExport void GetMagickToken(const char *start,const char **end,char *token)
|
||||
p++;
|
||||
break;
|
||||
}
|
||||
token[i++]=(*p);
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case '/':
|
||||
{
|
||||
token[i++]=(*p++);
|
||||
if ((*p == '>') || (*p == '/'))
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p++);
|
||||
if ((*p == '>') || (*p == '/'))
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p++);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -234,32 +240,36 @@ MagickExport void GetMagickToken(const char *start,const char **end,char *token)
|
||||
if ((p != q) && (*p != ','))
|
||||
{
|
||||
for ( ; (p < q) && (*p != ','); p++)
|
||||
token[i++]=(*p);
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p);
|
||||
if (*p == '%')
|
||||
token[i++]=(*p++);
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p++);
|
||||
break;
|
||||
}
|
||||
if ((*p != '\0') && (isalpha((int) ((unsigned char) *p)) == 0) &&
|
||||
(*p != *DirectorySeparator) && (*p != '#') && (*p != '<'))
|
||||
{
|
||||
token[i++]=(*p++);
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p++);
|
||||
break;
|
||||
}
|
||||
for ( ; *p != '\0'; p++)
|
||||
{
|
||||
if (((isspace((int) ((unsigned char) *p)) != 0) || (*p == '=') ||
|
||||
(*p == ':') || (*p == ',') || (*p == '|') || (*p == ';')) &&
|
||||
(*(p-1) != '\\'))
|
||||
(*p == ',') || (*p == ':') || (*p == ';')) && (*(p-1) != '\\'))
|
||||
break;
|
||||
if ((i > 0) && (*p == '<'))
|
||||
break;
|
||||
token[i++]=(*p);
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p);
|
||||
if (*p == '>')
|
||||
break;
|
||||
if (*p == '(')
|
||||
for (p++; *p != '\0'; p++)
|
||||
{
|
||||
token[i++]=(*p);
|
||||
if (i < (extent-1))
|
||||
token[i++]=(*p);
|
||||
if ((*p == ')') && (*(p-1) != '\\'))
|
||||
break;
|
||||
}
|
||||
|
||||
+8
-8
@@ -1108,7 +1108,7 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
|
||||
/*
|
||||
Interpret XML.
|
||||
*/
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
break;
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
@@ -1118,7 +1118,7 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
|
||||
Doctype element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"]>",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleNCompare(keyword,"<!--",4) == 0)
|
||||
@@ -1127,7 +1127,7 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
|
||||
Comment element.
|
||||
*/
|
||||
while ((LocaleNCompare(q,"->",2) != 0) && (*q != '\0'))
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
continue;
|
||||
}
|
||||
if (LocaleCompare(keyword,"<include") == 0)
|
||||
@@ -1138,10 +1138,10 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
|
||||
while (((*token != '/') && (*(token+1) != '>')) && (*q != '\0'))
|
||||
{
|
||||
(void) CopyMagickString(keyword,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare(keyword,"file") == 0)
|
||||
{
|
||||
if (depth > 200)
|
||||
@@ -1203,11 +1203,11 @@ static MagickBooleanType LoadTypeCache(SplayTreeInfo *type_cache,
|
||||
type_info=(TypeInfo *) NULL;
|
||||
continue;
|
||||
}
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token != '=')
|
||||
continue;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
switch (*keyword)
|
||||
{
|
||||
case 'E':
|
||||
|
||||
+1
-1
@@ -682,7 +682,7 @@ MagickExport Image *ConnectedComponentsImage(const Image *image,
|
||||
for (i=0; i < (ssize_t) component_image->colors; i++)
|
||||
{
|
||||
char
|
||||
mean_color[MaxTextExtent];
|
||||
mean_color[MagickPathExtent];
|
||||
|
||||
if (status == MagickFalse)
|
||||
break;
|
||||
|
||||
@@ -2210,7 +2210,7 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
|
||||
i++;
|
||||
if (i == (ssize_t) argc)
|
||||
ThrowConvertException(OptionError,"MissingArgument",option);
|
||||
GetMagickToken(argv[i],NULL,token);
|
||||
GetMagickToken(argv[i],(const char **) NULL,MagickPathExtent,token);
|
||||
op=ParseCommandOption(MagickMorphologyOptions,MagickFalse,token);
|
||||
if (op < 0)
|
||||
ThrowConvertException(OptionError,"UnrecognizedMorphologyMethod",
|
||||
|
||||
@@ -6379,14 +6379,14 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
|
||||
*p;
|
||||
|
||||
p=q;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
for (x=0; IsPoint(token) != MagickFalse; x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
CurrentContext->dash_pattern=(double *) AcquireQuantumMemory(
|
||||
(size_t) (2UL*x)+1UL,sizeof(*CurrentContext->dash_pattern));
|
||||
@@ -6395,9 +6395,9 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
|
||||
"MemoryAllocationFailed",wand->name);
|
||||
for (j=0; j < x; j++)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
CurrentContext->dash_pattern[j]=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
}
|
||||
|
||||
+28
-28
@@ -489,7 +489,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
x=0;
|
||||
while( *p != '\0' )
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == ',' ) continue;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
if ( color_from_image ) {
|
||||
@@ -536,7 +536,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
x=0;
|
||||
while( *p != '\0' && x < number_arguments ) {
|
||||
/* X coordinate */
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' ) break;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),
|
||||
@@ -547,7 +547,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
/* Y coordinate */
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' ) break;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),
|
||||
@@ -567,7 +567,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
#endif
|
||||
{
|
||||
/* color name or function given in string argument */
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' ) break;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
/* Color string given */
|
||||
@@ -590,7 +590,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
/* NB: token contains the first floating point value to use! */
|
||||
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -598,7 +598,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -606,7 +606,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -615,7 +615,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
|
||||
(image->colorspace == CMYKColorspace))
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -624,7 +624,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
|
||||
(image->alpha_trait != UndefinedPixelTrait))
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -1404,9 +1404,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
p=(char *) args;
|
||||
for (x=0; *p != '\0'; x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
number_arguments=(size_t) x;
|
||||
arguments=(double *) AcquireQuantumMemory(number_arguments,
|
||||
@@ -1419,9 +1419,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
p=(char *) args;
|
||||
for (x=0; (x < (ssize_t) number_arguments) && (*p != '\0'); x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
arguments[x]=StringToDouble(token,(char **) NULL);
|
||||
}
|
||||
args=DestroyString(args);
|
||||
@@ -1707,9 +1707,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
p=(char *) arguments;
|
||||
for (x=0; *p != '\0'; x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
number_parameters=(size_t) x;
|
||||
parameters=(double *) AcquireQuantumMemory(number_parameters,
|
||||
@@ -1722,9 +1722,9 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
p=(char *) arguments;
|
||||
for (x=0; (x < (ssize_t) number_parameters) && (*p != '\0'); x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
parameters[x]=StringToDouble(token,(char **) NULL);
|
||||
}
|
||||
arguments=DestroyString(arguments);
|
||||
@@ -1991,7 +1991,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
white_point;
|
||||
|
||||
p=(const char *) argv[i+1];
|
||||
GetMagickToken(p,&p,token); /* get black point color */
|
||||
GetMagickToken(p,&p,MagickPathExtent,token); /* get black point color */
|
||||
if ((isalpha((int) *token) != 0) || ((*token == '#') != 0))
|
||||
(void) QueryColorCompliance(token,AllCompliance,
|
||||
&black_point,exception);
|
||||
@@ -1999,13 +1999,13 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
(void) QueryColorCompliance("#000000",AllCompliance,
|
||||
&black_point,exception);
|
||||
if (isalpha((int) token[0]) || (token[0] == '#'))
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
white_point=black_point; /* set everything to that color */
|
||||
else
|
||||
{
|
||||
if ((isalpha((int) *token) == 0) && ((*token == '#') == 0))
|
||||
GetMagickToken(p,&p,token); /* Get white point color. */
|
||||
GetMagickToken(p,&p,MagickPathExtent,token); /* Get white point color. */
|
||||
if ((isalpha((int) *token) != 0) || ((*token == '#') != 0))
|
||||
(void) QueryColorCompliance(token,AllCompliance,
|
||||
&white_point,exception);
|
||||
@@ -2237,13 +2237,13 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
|
||||
*/
|
||||
(void) SyncImageSettings(mogrify_info,*image,exception);
|
||||
p=argv[i+1];
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
method=(MorphologyMethod) ParseCommandOption(
|
||||
MagickMorphologyOptions,MagickFalse,token);
|
||||
iterations=1L;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ((*p == ':') || (*p == ','))
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ((*p != '\0'))
|
||||
iterations=(ssize_t) StringToLong(p);
|
||||
kernel=AcquireKernelInfo(argv[i+2],exception);
|
||||
@@ -5458,7 +5458,7 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
|
||||
i++;
|
||||
if (i == (ssize_t) argc)
|
||||
ThrowMogrifyException(OptionError,"MissingArgument",option);
|
||||
GetMagickToken(argv[i],NULL,token);
|
||||
GetMagickToken(argv[i],(const char **) NULL,MagickPathExtent,token);
|
||||
op=ParseCommandOption(MagickMorphologyOptions,MagickFalse,token);
|
||||
if (op < 0)
|
||||
ThrowMogrifyException(OptionError,"UnrecognizedMorphologyMethod",
|
||||
@@ -8548,9 +8548,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
|
||||
p=(char *) args;
|
||||
for (x=0; *p != '\0'; x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
}
|
||||
number_arguments=(size_t) x;
|
||||
arguments=(double *) AcquireQuantumMemory(number_arguments,
|
||||
@@ -8563,9 +8563,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
|
||||
p=(char *) args;
|
||||
for (x=0; (x < (ssize_t) number_arguments) && (*p != '\0'); x++)
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
arguments[x]=StringToDouble(token,(char **) NULL);
|
||||
}
|
||||
args=DestroyString(args);
|
||||
|
||||
+15
-15
@@ -233,7 +233,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
x=0;
|
||||
while( *p != '\0' )
|
||||
{
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == ',' ) continue;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' )
|
||||
x += number_colors; /* color argument found */
|
||||
@@ -265,7 +265,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
x=0;
|
||||
while( *p != '\0' && x < number_arguments ) {
|
||||
/* X coordinate */
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' ) break;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),
|
||||
@@ -276,7 +276,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
/* Y coordinate */
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' ) break;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
(void) ThrowMagickException(exception,GetMagickModule(),
|
||||
@@ -287,7 +287,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
/* color name or function given in string argument */
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
token[0]=','; while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' ) break;
|
||||
if ( isalpha((int) token[0]) || token[0] == '#' ) {
|
||||
/* Color string given */
|
||||
@@ -311,7 +311,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
/* NB: token contains the first floating point value to use! */
|
||||
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -319,7 +319,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -327,7 +327,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
}
|
||||
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -336,7 +336,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
|
||||
(image->colorspace == CMYKColorspace))
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -345,7 +345,7 @@ static Image *SparseColorOption(const Image *image,
|
||||
if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
|
||||
image->alpha_trait != UndefinedPixelTrait)
|
||||
{
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,token);
|
||||
while ( token[0] == ',' ) GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ( token[0] == '\0' || isalpha((int)token[0]) || token[0] == '#' )
|
||||
break;
|
||||
sparse_arguments[x++]=StringToDouble(token,(char **) NULL);
|
||||
@@ -2645,7 +2645,7 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
|
||||
white_point;
|
||||
|
||||
p=(const char *) arg1;
|
||||
GetMagickToken(p,&p,token); /* get black point color */
|
||||
GetMagickToken(p,&p,MagickPathExtent,token); /* get black point color */
|
||||
if ((isalpha((int) *token) != 0) || ((*token == '#') != 0))
|
||||
(void) QueryColorCompliance(token,AllCompliance,
|
||||
&black_point,_exception);
|
||||
@@ -2653,13 +2653,13 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
|
||||
(void) QueryColorCompliance("#000000",AllCompliance,
|
||||
&black_point,_exception);
|
||||
if (isalpha((int) token[0]) || (token[0] == '#'))
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == '\0')
|
||||
white_point=black_point; /* set everything to that color */
|
||||
else
|
||||
{
|
||||
if ((isalpha((int) *token) == 0) && ((*token == '#') == 0))
|
||||
GetMagickToken(p,&p,token); /* Get white point color. */
|
||||
GetMagickToken(p,&p,MagickPathExtent,token); /* Get white point color. */
|
||||
if ((isalpha((int) *token) != 0) || ((*token == '#') != 0))
|
||||
(void) QueryColorCompliance(token,AllCompliance,
|
||||
&white_point,_exception);
|
||||
@@ -2818,15 +2818,15 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand,
|
||||
iterations;
|
||||
|
||||
p=arg1;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
parse=ParseCommandOption(MagickMorphologyOptions,MagickFalse,token);
|
||||
if ( parse < 0 )
|
||||
CLIWandExceptArgBreak(OptionError,"UnrecognizedFunction",option,
|
||||
arg1);
|
||||
iterations=1L;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ((*p == ':') || (*p == ','))
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if ((*p != '\0'))
|
||||
iterations=(ssize_t) StringToLong(p);
|
||||
kernel=AcquireKernelInfo(arg2,exception);
|
||||
|
||||
+2
-2
@@ -2802,11 +2802,11 @@ RestoreMSCWarning
|
||||
utf16=ConvertUTF8ToUTF16((unsigned char *) basename,&length);
|
||||
if (utf16 != (wchar_t *) NULL)
|
||||
{
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,"/Title (\xfe\xff");
|
||||
(void) FormatLocaleString(buffer,MagickPathExtent,"/Title (\xfe\xff");
|
||||
(void) WriteBlobString(image,buffer);
|
||||
for (i=0; i < (ssize_t) length; i++)
|
||||
WriteBlobMSBShort(image,(unsigned short) utf16[i]);
|
||||
(void) FormatLocaleString(buffer,MaxTextExtent,")\n");
|
||||
(void) FormatLocaleString(buffer,MagickPathExtent,")\n");
|
||||
(void) WriteBlobString(image,buffer);
|
||||
utf16=(wchar_t *) RelinquishMagickMemory(utf16);
|
||||
}
|
||||
|
||||
+128
-128
@@ -299,7 +299,7 @@ static double GetUserSpaceCoordinateValue(const SVGInfo *svg_info,int type,
|
||||
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",string);
|
||||
assert(string != (const char *) NULL);
|
||||
p=(const char *) string;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
value=StringToDouble(token,(char **) NULL);
|
||||
if (strchr(token,'%') != (char *) NULL)
|
||||
{
|
||||
@@ -323,7 +323,7 @@ static double GetUserSpaceCoordinateValue(const SVGInfo *svg_info,int type,
|
||||
beta=value-svg_info->view_box.height;
|
||||
return(hypot(alpha,beta)/sqrt(2.0)/100.0);
|
||||
}
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (LocaleNCompare(token,"cm",2) == 0)
|
||||
return(DefaultResolution*svg_info->scale[0]/2.54*value);
|
||||
if (LocaleNCompare(token,"em",2) == 0)
|
||||
@@ -1307,27 +1307,27 @@ static void SVGStartElement(void *context,const xmlChar *name,
|
||||
if (LocaleCompare(keyword,"matrix") == 0)
|
||||
{
|
||||
p=(const char *) value;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.sx=StringToDouble(value,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.rx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.ry=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.sy=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.tx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.ty=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -1924,27 +1924,27 @@ static void SVGStartElement(void *context,const xmlChar *name,
|
||||
if (LocaleCompare(keyword,"matrix") == 0)
|
||||
{
|
||||
p=(const char *) value;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.sx=StringToDouble(value,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.rx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.ry=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.sy=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.tx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
affine.ty=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -1961,15 +1961,15 @@ static void SVGStartElement(void *context,const xmlChar *name,
|
||||
y;
|
||||
|
||||
p=(const char *) value;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
angle=StringToDouble(value,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
y=StringToDouble(token,(char **) NULL);
|
||||
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
|
||||
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
|
||||
@@ -2071,22 +2071,22 @@ static void SVGStartElement(void *context,const xmlChar *name,
|
||||
if (LocaleCompare(keyword,"viewBox") == 0)
|
||||
{
|
||||
p=(const char *) value;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
svg_info->view_box.x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
svg_info->view_box.y=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
svg_info->view_box.width=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
if (svg_info->bounds.width == 0)
|
||||
svg_info->bounds.width=svg_info->view_box.width;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
svg_info->view_box.height=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
if (svg_info->bounds.height == 0)
|
||||
@@ -3683,7 +3683,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
/*
|
||||
Interpret graphic primitive.
|
||||
*/
|
||||
GetMagickToken(q,&q,keyword);
|
||||
GetMagickToken(q,&q,MagickPathExtent,keyword);
|
||||
if (*keyword == '\0')
|
||||
break;
|
||||
if (*keyword == '#')
|
||||
@@ -3719,27 +3719,27 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("affine",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.rx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.ry=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sy=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.tx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.ty=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -3750,7 +3750,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("angle",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.rx=StringToDouble(token,(char **) NULL);
|
||||
affine.ry=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
@@ -3779,7 +3779,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("clip-path",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"clip-path:url(#%s);",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3787,7 +3787,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("clip-rule",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"clip-rule:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3795,7 +3795,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("clip-units",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"clipPathUnits=%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3819,7 +3819,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("decorate",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"text-decoration:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3844,7 +3844,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("fill",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"fill:%s;",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3852,7 +3852,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("fill-rule",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"fill-rule:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3860,7 +3860,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("fill-alpha",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"fill-alpha:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3868,7 +3868,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("font-family",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"font-family:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3876,7 +3876,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("font-stretch",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"font-stretch:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3884,7 +3884,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("font-style",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"font-style:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3892,7 +3892,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("font-size",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"font-size:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3900,7 +3900,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("font-weight",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"font-weight:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3914,12 +3914,12 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("gradient-units",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("text-align",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"text-align %s ",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3927,7 +3927,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("text-anchor",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"text-anchor %s ",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3941,7 +3941,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("image",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
primitive_type=ImagePrimitive;
|
||||
break;
|
||||
}
|
||||
@@ -3964,7 +3964,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("opacity",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"opacity %s ",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -3998,7 +3998,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("pop",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare("clip-path",token) == 0)
|
||||
{
|
||||
(void) WriteBlobString(image,"</clipPath>\n");
|
||||
@@ -4035,10 +4035,10 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("push",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare("clip-path",token) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"<clipPath id=\"%s\">\n",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4051,27 +4051,27 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("gradient",token) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(name,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(type,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.segment.x1=StringToDouble(token,(char **) NULL);
|
||||
svg_info.element.cx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.segment.y1=StringToDouble(token,(char **) NULL);
|
||||
svg_info.element.cy=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.segment.x2=StringToDouble(token,(char **) NULL);
|
||||
svg_info.element.major=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.segment.y2=StringToDouble(token,(char **) NULL);
|
||||
svg_info.element.minor=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
@@ -4081,9 +4081,9 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
svg_info.segment.y1,svg_info.segment.x2,svg_info.segment.y2);
|
||||
if (LocaleCompare(type,"radial") == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.element.angle=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
@@ -4109,22 +4109,22 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("pattern",token) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(name,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.bounds.x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.bounds.y=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.bounds.width=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
svg_info.bounds.height=StringToDouble(token,
|
||||
(char **) NULL);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
@@ -4155,7 +4155,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("rotate",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"rotate(%s) ",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4169,17 +4169,17 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("scale",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.sy=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
if (LocaleCompare("skewX",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"skewX(%s) ",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4187,7 +4187,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("skewY",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"skewY(%s) ",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4198,9 +4198,9 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
char
|
||||
color[MagickPathExtent];
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) CopyMagickString(color,token,MagickPathExtent);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
" <stop offset=\"%s\" stop-color=\"%s\" />\n",token,color);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4208,7 +4208,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"stroke:%s;",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4216,7 +4216,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-antialias",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-antialias:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4230,13 +4230,13 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
k;
|
||||
|
||||
p=q;
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
for (k=0; IsPoint(token); k++)
|
||||
GetMagickToken(p,&p,token);
|
||||
GetMagickToken(p,&p,MagickPathExtent,token);
|
||||
(void) WriteBlobString(image,"stroke-dasharray:");
|
||||
for (j=0; j < k; j++)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,"%s ",
|
||||
token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4244,7 +4244,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
(void) WriteBlobString(image,";");
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-dasharray:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4252,7 +4252,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-dashoffset",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-dashoffset:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4260,7 +4260,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-linecap",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-linecap:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4268,7 +4268,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-linejoin",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-linejoin:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4276,7 +4276,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-miterlimit",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-miterlimit:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4284,7 +4284,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-opacity",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-opacity:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4292,7 +4292,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("stroke-width",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"stroke-width:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4311,7 +4311,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("text-antialias",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
"text-antialias:%s;",token);
|
||||
(void) WriteBlobString(image,message);
|
||||
@@ -4324,11 +4324,11 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
}
|
||||
if (LocaleCompare("translate",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.tx=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
affine.ty=StringToDouble(token,(char **) NULL);
|
||||
break;
|
||||
}
|
||||
@@ -4340,16 +4340,16 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
{
|
||||
if (LocaleCompare("viewbox",keyword) == 0)
|
||||
{
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
break;
|
||||
}
|
||||
status=MagickFalse;
|
||||
@@ -4377,15 +4377,15 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
*/
|
||||
if (IsPoint(q) == MagickFalse)
|
||||
break;
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
point.x=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
point.y=StringToDouble(token,(char **) NULL);
|
||||
GetMagickToken(q,(const char **) NULL,token);
|
||||
GetMagickToken(q,(const char **) NULL,MagickPathExtent,token);
|
||||
if (*token == ',')
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
primitive_info[i].primitive=primitive_type;
|
||||
primitive_info[i].point=point;
|
||||
primitive_info[i].coordinates=0;
|
||||
@@ -4582,7 +4582,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
int
|
||||
number_attributes;
|
||||
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
number_attributes=1;
|
||||
for (p=token; *p != '\0'; p++)
|
||||
if (isalpha((int) *p))
|
||||
@@ -4613,7 +4613,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
status=MagickFalse;
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
if (LocaleCompare("point",token) == 0)
|
||||
primitive_info[j].method=PointMethod;
|
||||
if (LocaleCompare("replace",token) == 0)
|
||||
@@ -4636,7 +4636,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
status=MagickFalse;
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
" <text x=\"%g\" y=\"%g\">",primitive_info[j].point.x,
|
||||
primitive_info[j].point.y);
|
||||
@@ -4659,7 +4659,7 @@ static MagickBooleanType WriteSVGImage(const ImageInfo *image_info,Image *image,
|
||||
status=MagickFalse;
|
||||
break;
|
||||
}
|
||||
GetMagickToken(q,&q,token);
|
||||
GetMagickToken(q,&q,MagickPathExtent,token);
|
||||
(void) FormatLocaleString(message,MagickPathExtent,
|
||||
" <image x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" "
|
||||
"xlink:href=\"%s\"/>\n",primitive_info[j].point.x,
|
||||
|
||||
Reference in New Issue
Block a user