% Execute Magick Scripting Language Scripts. %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% Leonard Rosenthol %
% William Radcliffe %
% December 2001 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
#include "MagickCore/studio.h"
#include "MagickCore/annotate.h"
#include "MagickCore/artifact.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/cache.h"
#include "MagickCore/cache-view.h"
+#include "MagickCore/channel.h"
#include "MagickCore/color.h"
#include "MagickCore/color-private.h"
#include "MagickCore/colormap.h"
#include "MagickCore/constitute.h"
#include "MagickCore/decorate.h"
#include "MagickCore/display.h"
+#include "MagickCore/distort.h"
#include "MagickCore/draw.h"
#include "MagickCore/effect.h"
#include "MagickCore/enhance.h"
#include "MagickCore/segment.h"
#include "MagickCore/shear.h"
#include "MagickCore/signature.h"
+#include "MagickCore/statistic.h"
#include "MagickCore/static.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/utility.h"
#if defined(MAGICKCORE_XML_DELEGATE)
# if defined(MAGICKCORE_WINDOWS_SUPPORT)
-# if defined(__MINGW32__)
-# define _MSC_VER
-# else
+# if !defined(__MINGW32__) && !defined(__MINGW64__)
# include <win32config.h>
# endif
# endif
ExceptionInfo *exception)
{
char
- key[MaxTextExtent];
+ key[MagickPathExtent];
ExceptionInfo
*sans_exception;
ImageInfo
*read_info;
- (void) FormatLocaleString(key,MaxTextExtent,"cache:%s",path);
+ (void) FormatLocaleString(key,MagickPathExtent,"cache:%s",path);
sans_exception=AcquireExceptionInfo();
image=(Image *) GetImageRegistry(ImageRegistryType,key,sans_exception);
sans_exception=DestroyExceptionInfo(sans_exception);
if (image != (Image *) NULL)
return(image);
read_info=CloneImageInfo(image_info);
- (void) CopyMagickString(read_info->filename,path,MaxTextExtent);
+ (void) CopyMagickString(read_info->filename,path,MagickPathExtent);
image=ReadImage(read_info,exception);
read_info=DestroyImageInfo(read_info);
if (image != (Image *) NULL)
msl_info->image=(Image **) ResizeQuantumMemory(msl_info->image,(n+1),
sizeof(*msl_info->image));
if ((msl_info->image_info == (ImageInfo **) NULL) ||
- (msl_info->draw_info == (DrawInfo **) NULL) ||
- (msl_info->attributes == (Image **) NULL) ||
- (msl_info->image == (Image **) NULL))
- ThrowMSLException(ResourceLimitFatalError,"MemoryAllocationFailed","msl");
+ (msl_info->draw_info == (DrawInfo **) NULL) ||
+ (msl_info->attributes == (Image **) NULL) ||
+ (msl_info->image == (Image **) NULL))
+ ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed")
msl_info->image_info[n]=CloneImageInfo(msl_info->image_info[n-1]);
msl_info->draw_info[n]=CloneDrawInfo(msl_info->image_info[n-1],
msl_info->draw_info[n-1]);
msl_info->exception);
msl_info->image[n]=(Image *) image;
if ((msl_info->image_info[n] == (ImageInfo *) NULL) ||
- (msl_info->attributes[n] == (Image *) NULL))
- ThrowMSLException(ResourceLimitFatalError,"MemoryAllocationFailed","msl");
+ (msl_info->attributes[n] == (Image *) NULL))
+ ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed")
if (msl_info->number_groups != 0)
msl_info->group_info[msl_info->number_groups-1].numImages++;
}
channel_mask;
char
- key[MaxTextExtent],
+ key[MagickPathExtent],
*value;
const char
*draw_info;
ExceptionInfo
- exception;
+ *exception;
GeometryInfo
geometry_info;
*/
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.startElement(%s",tag);
- GetExceptionInfo(&exception);
+ exception=AcquireExceptionInfo();
msl_info=(MSLInfo *) context;
n=msl_info->n;
keyword=(const char *) NULL;
value=(char *) NULL;
SetGeometryInfo(&geometry_info);
+ (void) ResetMagickMemory(&geometry,0,sizeof(geometry));
channel=DefaultChannels;
switch (*tag)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
noise_image=AddNoiseImage(msl_info->image[n],noise,1.0,
msl_info->exception);
- (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
+ (void) SetPixelChannelMask(msl_info->image[n],channel_mask);
if (noise_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
if (LocaleCompare((const char *) tag,"annotate") == 0)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
/*
Annotate image.
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=InterpretLocaleValue(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=InterpretLocaleValue(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=InterpretLocaleValue(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=InterpretLocaleValue(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=InterpretLocaleValue(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=InterpretLocaleValue(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickBooleanOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseGravityGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
if (LocaleCompare(keyword,"gravity") == 0)
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=InterpretLocaleValue(value,
- (char **) NULL);
+ draw_info->pointsize=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
if (LocaleCompare(keyword, "stroke") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->stroke,&exception);
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
if (LocaleCompare(keyword, "undercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->undercolor,&exception);
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
- (char **) NULL);
+ geometry_info.rho=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
blur_image=BlurImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,geometry_info.xi,
- msl_info->exception);
- (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
+ geometry_info.sigma,msl_info->exception);
+ (void) SetPixelChannelMask(msl_info->image[n],channel_mask);
if (blur_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->border_color,&exception);
+ &msl_info->image[n]->border_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
if (LocaleCompare((const char *) tag,"colorize") == 0)
{
char
- blend[MaxTextExtent];
+ blend[MagickPathExtent];
Image
*colorize_image;
break;
}
GetPixelInfo(msl_info->image[n],&target);
- (void) CopyMagickString(blend,"100",MaxTextExtent);
+ (void) CopyMagickString(blend,"100",MagickPathExtent);
if (attributes != (const xmlChar **) NULL)
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blend") == 0)
{
- (void) CopyMagickString(blend,value,MaxTextExtent);
+ (void) CopyMagickString(blend,value,MagickPathExtent);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare((const char *) tag, "charcoal") == 0)
{
- double bias = 0.0,
+ double
radius = 0.0,
sigma = 1.0;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
- case 'B':
- case 'b':
- {
- if (LocaleCompare(keyword, "bias") == 0)
- {
- bias = InterpretLocaleValue(value,(char **) NULL);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
case 'R':
case 'r':
{
- if (LocaleCompare(keyword, "radius") == 0)
+ if (LocaleCompare(keyword,"radius") == 0)
{
- radius = InterpretLocaleValue(value,(char **) NULL);
+ radius=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=CharcoalImage(msl_info->image[n],radius,sigma,bias,
+ newImage=CharcoalImage(msl_info->image[n],radius,sigma,
msl_info->exception);
if (newImage == (Image *) NULL)
break;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &target,&exception);
+ &target,exception);
paint_method=FillToBorderMethod;
break;
}
if (LocaleCompare(keyword,"fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ msl_info->image[n]->fuzz=StringToDouble(value,
(char **) NULL);
break;
}
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare((const char *) tag,"composite") == 0)
{
char
- composite_geometry[MaxTextExtent];
+ composite_geometry[MagickPathExtent];
CompositeOperator
compose;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*attribute;
attribute=GetImageProperty(msl_info->attributes[j],"id",
- &exception);
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
composite_image=CloneImage(msl_info->image[j],0,0,
- MagickFalse,&exception);
+ MagickFalse,exception);
break;
}
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "color") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &composite_image->background_color,&exception);
+ &composite_image->background_color,exception);
break;
}
if (LocaleCompare(keyword,"compose") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
*attribute;
attribute=GetImageProperty(msl_info->attributes[j],"id",
- &exception);
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(value,value) == 0))
{
- SetImageType(composite_image,TrueColorMatteType,
- &exception);
+ SetImageType(composite_image,TrueColorAlphaType,
+ exception);
(void) CompositeImage(composite_image,
- CopyOpacityCompositeOp,msl_info->image[j],0,0,
- &exception);
+ msl_info->image[j],CopyAlphaCompositeOp,MagickTrue,
+ 0,0,exception);
break;
}
}
if (compose != DissolveCompositeOp)
{
(void) SetImageAlpha(composite_image,(Quantum)
- opacity,&exception);
+ opacity,exception);
break;
}
(void) SetImageArtifact(msl_info->image[n],
"compose:args",value);
- if (composite_image->matte != MagickTrue)
+ if (composite_image->alpha_trait == UndefinedPixelTrait)
(void) SetImageAlpha(composite_image,OpaqueAlpha,
- &exception);
- composite_view=AcquireCacheView(composite_image);
+ exception);
+ composite_view=AcquireAuthenticCacheView(composite_image,exception);
for (y=0; y < (ssize_t) composite_image->rows ; y++)
{
q=GetCacheViewAuthenticPixels(composite_view,0,y,
- (ssize_t) composite_image->columns,1,&exception);
+ (ssize_t) composite_image->columns,1,exception);
for (x=0; x < (ssize_t) composite_image->columns; x++)
{
if (GetPixelAlpha(composite_image,q) == OpaqueAlpha)
ClampToQuantum(opacity),q);
q+=GetPixelChannels(composite_image);
}
- if (SyncCacheViewAuthenticPixels(composite_view,&exception) == MagickFalse)
+ if (SyncCacheViewAuthenticPixels(composite_view,exception) == MagickFalse)
break;
}
composite_view=DestroyCacheView(composite_view);
if (LocaleCompare(keyword,"rotate") == 0)
{
rotate_image=RotateImage(composite_image,
- InterpretLocaleValue(value,(char **) NULL),&exception);
+ StringToDouble(value,(char **) NULL),exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
for (x=0; x < (ssize_t) image->columns; x+=(ssize_t) width)
{
if (rotate_image != (Image *) NULL)
- (void) CompositeImage(image,compose,rotate_image,
- x,y,&exception);
+ (void) CompositeImage(image,rotate_image,compose,
+ MagickTrue,x,y,exception);
else
- (void) CompositeImage(image,compose,
- composite_image,x,y,&exception);
+ (void) CompositeImage(image,composite_image,
+ compose,MagickTrue,x,y,exception);
}
if (rotate_image != (Image *) NULL)
rotate_image=DestroyImage(rotate_image);
}
}
image=msl_info->image[n];
- (void) FormatLocaleString(composite_geometry,MaxTextExtent,
+ (void) FormatLocaleString(composite_geometry,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,
(double) composite_image->rows,(double) geometry.x,(double)
geometry.y);
flags=ParseGravityGeometry(image,composite_geometry,&geometry,
- &exception);
- channel_mask=SetPixelChannelMask(image,channel);
+ exception);
+ channel_mask=SetImageChannelMask(image,channel);
if (rotate_image == (Image *) NULL)
- CompositeImage(image,compose,composite_image,geometry.x,geometry.y,
- &exception);
+ CompositeImage(image,composite_image,compose,MagickTrue,geometry.x,
+ geometry.y,exception);
else
{
/*
composite_image->columns)/2;
geometry.y-=(ssize_t) (rotate_image->rows-
composite_image->rows)/2;
- CompositeImage(image,compose,rotate_image,geometry.x,geometry.y,
- &exception);
+ CompositeImage(image,rotate_image,compose,MagickTrue,geometry.x,
+ geometry.y,exception);
rotate_image=DestroyImage(rotate_image);
}
- (void) SetPixelChannelMask(image,channel_mask);
+ (void) SetImageChannelMask(image,channel_mask);
composite_image=DestroyImage(composite_image);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseGravityGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) CycleColormapImage(msl_info->image[n],display,&exception);
+ (void) CycleColormapImage(msl_info->image[n],display,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare((const char *) tag,"draw") == 0)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
/*
Annotate image.
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=InterpretLocaleValue(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=InterpretLocaleValue(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=InterpretLocaleValue(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=InterpretLocaleValue(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=InterpretLocaleValue(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=InterpretLocaleValue(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
case 'P':
case 'p':
{
- if (LocaleCompare(keyword,"primitive") == 0)
+ if (LocaleCompare(keyword,"points") == 0)
{
- CloneString(&draw_info->primitive,value);
+ if (LocaleCompare(draw_info->primitive,"path") == 0)
+ {
+ (void) ConcatenateString(&draw_info->primitive," '");
+ ConcatenateString(&draw_info->primitive,value);
+ (void) ConcatenateString(&draw_info->primitive,"'");
+ }
+ else
+ {
+ (void) ConcatenateString(&draw_info->primitive," ");
+ ConcatenateString(&draw_info->primitive,value);
+ }
break;
}
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=InterpretLocaleValue(value,
+ draw_info->pointsize=StringToDouble(value,
(char **) NULL);
break;
}
+ if (LocaleCompare(keyword,"primitive") == 0)
+ {
+ CloneString(&draw_info->primitive,value);
+ break;
+ }
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword);
break;
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword, "stroke") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->stroke,&exception);
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
{
if (LocaleCompare(keyword,"text") == 0)
{
- CloneString(&draw_info->text,value);
+ (void) ConcatenateString(&draw_info->primitive," '");
+ (void) ConcatenateString(&draw_info->primitive,value);
+ (void) ConcatenateString(&draw_info->primitive,"'");
break;
}
if (LocaleCompare(keyword,"translate") == 0)
if (LocaleCompare(keyword, "undercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->undercolor,&exception);
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
affine.tx;
draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
affine.ty;
- (void) DrawImage(msl_info->image[n],draw_info,&exception);
+ (void) DrawImage(msl_info->image[n],draw_info,exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
- (char **) NULL);
+ geometry_info.rho=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
edge_image=EdgeImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,msl_info->exception);
+ msl_info->exception);
if (edge_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
(const char *) tag);
break;
}
+ (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
SetGeometry(msl_info->image[n],&geometry);
if (attributes != (const xmlChar **) NULL)
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->matte_color,&exception);
+ &msl_info->image[n]->alpha_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
frame_info.width=geometry.width;
if (LocaleCompare((const char *) tag,"gamma") == 0)
{
char
- gamma[MaxTextExtent];
+ gamma[MagickPathExtent];
PixelInfo
pixel;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blue") == 0)
{
- pixel.blue=InterpretLocaleValue(value,(char **) NULL);
+ pixel.blue=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- (void) CopyMagickString(gamma,value,MaxTextExtent);
+ (void) CopyMagickString(gamma,value,MagickPathExtent);
break;
}
if (LocaleCompare(keyword,"green") == 0)
{
- pixel.green=InterpretLocaleValue(value,(char **) NULL);
+ pixel.green=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"red") == 0)
{
- pixel.red=InterpretLocaleValue(value,(char **) NULL);
+ pixel.red=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
if (*gamma == '\0')
- (void) FormatLocaleString(gamma,MaxTextExtent,"%g,%g,%g",
+ (void) FormatLocaleString(gamma,MagickPathExtent,"%g,%g,%g",
(double) pixel.red,(double) pixel.green,(double) pixel.blue);
- (void) GammaImage(msl_info->image[n],atof(gamma),
+ (void) GammaImage(msl_info->image[n],strtod(gamma,(char **) NULL),
msl_info->exception);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,(const char *) attributes[i]);
- (void) CopyMagickString(key,value,MaxTextExtent);
+ (void) CopyMagickString(key,value,MagickPathExtent);
switch (*keyword)
{
case 'H':
{
if (LocaleCompare(keyword,"height") == 0)
{
- (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
+ (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
(double) msl_info->image[n]->rows);
(void) SetImageProperty(msl_info->attributes[n],key,value,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"width") == 0)
{
- (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
+ (void) FormatLocaleString(value,MagickPathExtent,"%.20g",
(double) msl_info->image[n]->columns);
(void) SetImageProperty(msl_info->attributes[n],key,value,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
*next_image;
(void) CopyMagickString(msl_info->image_info[n]->filename,
- "xc:",MaxTextExtent);
+ "xc:",MagickPathExtent);
(void) ConcatenateMagickString(msl_info->image_info[n]->
- filename,value,MaxTextExtent);
- next_image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
+ filename,value,MagickPathExtent);
+ next_image=ReadImage(msl_info->image_info[n],exception);
+ CatchException(exception);
if (next_image == (Image *) NULL)
continue;
if (msl_info->image[n] == (Image *) NULL)
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"amount") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,(const char *) attributes[i]);
- (void) CopyMagickString(key,value,MaxTextExtent);
+ (void) CopyMagickString(key,value,MagickPathExtent);
switch (*keyword)
{
case 'B':
{
if (LocaleCompare(keyword,"black") == 0)
{
- levelBlack = InterpretLocaleValue(value,(char **) NULL);
+ levelBlack = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- levelGamma = InterpretLocaleValue(value,(char **) NULL);
+ levelGamma = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"white") == 0)
{
- levelWhite = InterpretLocaleValue(value,(char **) NULL);
+ levelWhite = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*attribute;
attribute=GetImageProperty(msl_info->attributes[j],"id",
- &exception);
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
affinity_image=CloneImage(msl_info->image[j],0,0,
- MagickFalse,&exception);
+ MagickFalse,exception);
break;
}
}
}
}
quantize_info=AcquireQuantizeInfo(msl_info->image_info[n]);
- quantize_info->dither=dither;
+ quantize_info->dither_method=dither != MagickFalse ?
+ RiemersmaDitherMethod : NoDitherMethod;
(void) RemapImages(quantize_info,msl_info->image[n],
- affinity_image,&exception);
+ affinity_image,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
affinity_image=DestroyImage(affinity_image);
break;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &target,&exception);
+ &target,exception);
paint_method=FillToBorderMethod;
break;
}
{
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ msl_info->image[n]->fuzz=StringToDouble(value,
(char **) NULL);
break;
}
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- opacity=InterpretLocaleValue(value,(char **) NULL);
+ opacity=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
- &exception);
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
draw_info=CloneDrawInfo(msl_info->image_info[n],
msl_info->draw_info[n]);
draw_info->fill.alpha=ClampToQuantum(opacity);
- channel_mask=SetPixelChannelMask(msl_info->image[n],AlphaChannel);
+ channel_mask=SetImageChannelMask(msl_info->image[n],AlphaChannel);
(void) FloodfillPaintImage(msl_info->image[n],draw_info,&target,
geometry.x,geometry.y,paint_method == FloodfillMethod ?
MagickFalse : MagickTrue,msl_info->exception);
- (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
+ (void) SetPixelChannelMask(msl_info->image[n],channel_mask);
draw_info=DestroyDrawInfo(draw_info);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
if (LocaleCompare((const char *) tag,"modulate") == 0)
{
char
- modulate[MaxTextExtent];
+ modulate[MagickPathExtent];
/*
Modulate image.
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blackness") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
if (LocaleCompare(keyword,"brightness") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"hue") == 0)
{
- geometry_info.xi=InterpretLocaleValue(value,
+ geometry_info.xi=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"lightness") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"saturation") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"whiteness") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
}
}
}
- (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
+ (void) FormatLocaleString(modulate,MagickPathExtent,"%g,%g,%g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
(void) ModulateImage(msl_info->image[n],modulate,
msl_info->exception);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
(void) NegateImage(msl_info->image[n],gray,
msl_info->exception);
- (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
+ (void) SetPixelChannelMask(msl_info->image[n],channel_mask);
break;
}
if (LocaleCompare((const char *) tag,"normalize") == 0)
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
break;
}
(void) QueryColorCompliance("none",AllCompliance,&target,
- &exception);
+ exception);
(void) QueryColorCompliance("none",AllCompliance,&fill_color,
- &exception);
+ exception);
if (attributes != (const xmlChar **) NULL)
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &fill_color,&exception);
+ &fill_color,exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+ msl_info->image[n]->fuzz=StringToDouble(value,
(char **) NULL);
break;
}
}
}
}
- channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
(void) OpaquePaintImage(msl_info->image[n],&target,&fill_color,
MagickFalse,msl_info->exception);
- (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
+ (void) SetPixelChannelMask(msl_info->image[n],channel_mask);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
- if (*keyword == '+')
+ if (*keyword == '!')
{
/*
Remove a profile from the image.
*/
(void) ProfileImage(msl_info->image[n],keyword,
- (const unsigned char *) NULL,0,&exception);
+ (const unsigned char *) NULL,0,exception);
continue;
}
/*
profile=GetImageProfile(msl_info->image[n],"iptc");
if (profile != (StringInfo *) NULL)
profile_info->profile=(void *) CloneStringInfo(profile);
- profile_image=GetImageCache(profile_info,keyword,&exception);
+ profile_image=GetImageCache(profile_info,keyword,exception);
profile_info=DestroyImageInfo(profile_info);
if (profile_image == (Image *) NULL)
{
char
- name[MaxTextExtent],
- filename[MaxTextExtent];
+ name[MagickPathExtent],
+ filename[MagickPathExtent];
register char
*p;
StringInfo
*profile;
- (void) CopyMagickString(filename,keyword,MaxTextExtent);
- (void) CopyMagickString(name,keyword,MaxTextExtent);
+ (void) CopyMagickString(filename,keyword,MagickPathExtent);
+ (void) CopyMagickString(name,keyword,MagickPathExtent);
for (p=filename; *p != '\0'; p++)
if ((*p == ':') && (IsPathDirectory(keyword) < 0) &&
(IsPathAccessible(keyword) == MagickFalse))
*q=(*++p);
break;
}
- profile=FileToStringInfo(filename,~0UL,&exception);
+ profile=FileToStringInfo(filename,~0UL,exception);
if (profile != (StringInfo *) NULL)
{
(void) ProfileImage(msl_info->image[n],name,
GetStringInfoDatum(profile),(size_t)
- GetStringInfoLength(profile),MagickFalse);
+ GetStringInfoLength(profile),exception);
profile=DestroyStringInfo(profile);
}
continue;
if (profile != (StringInfo *) NULL)
(void) ProfileImage(msl_info->image[n],name,
GetStringInfoDatum(profile),(size_t)
- GetStringInfoLength(profile),MagickFalse);
+ GetStringInfoLength(profile),exception);
name=GetNextImageProfile(profile_image);
}
profile_image=DestroyImage(profile_image);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"dither") == 0)
{
- option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickDitherOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
- quantize_info.dither=(MagickBooleanType) option;
+ quantize_info.dither_method=(DitherMethod) option;
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) QuantizeImage(&quantize_info,msl_info->image[n],&exception);
+ (void) QuantizeImage(&quantize_info,msl_info->image[n],exception);
break;
}
if (LocaleCompare((const char *) tag,"query-font-metrics") == 0)
{
char
- text[MaxTextExtent];
+ text[MagickPathExtent];
MagickBooleanType
status;
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=InterpretLocaleValue(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=InterpretLocaleValue(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=InterpretLocaleValue(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=InterpretLocaleValue(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=InterpretLocaleValue(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=InterpretLocaleValue(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->fill,&exception);
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=InterpretLocaleValue(value,
+ draw_info->pointsize=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.sx=cos(DegreesToRadians(fmod(angle,360.0)));
affine.rx=sin(DegreesToRadians(fmod(angle,360.0)));
affine.ry=(-sin(DegreesToRadians(fmod(angle,360.0))));
}
if (LocaleCompare(keyword,"skewX") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=InterpretLocaleValue(value,(char **) NULL);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword, "stroke") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->stroke,&exception);
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
if (LocaleCompare(keyword, "undercolor") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &draw_info->undercolor,&exception);
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatLocaleString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'F':
Image
*image;
+ if (value == (char *) NULL)
+ break;
(void) CopyMagickString(msl_info->image_info[n]->filename,
- value,MaxTextExtent);
- image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
+ value,MagickPathExtent);
+ image=ReadImage(msl_info->image_info[n],exception);
+ CatchException(exception);
if (image == (Image *) NULL)
continue;
AppendImageToList(&msl_info->image[n],image);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
- case 'b':
- {
- if (LocaleCompare(keyword,"blur") == 0)
- {
- msl_info->image[n]->blur=InterpretLocaleValue(value,
- (char **) NULL);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
case 'G':
case 'g':
{
{
if (LocaleCompare(keyword,"x-resolution") == 0)
{
- x_resolution=InterpretLocaleValue(value,(char **) NULL);
+ x_resolution=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"y-resolution") == 0)
{
- y_resolution=InterpretLocaleValue(value,(char **) NULL);
+ y_resolution=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
if (msl_info->image[n]->units == PixelsPerCentimeterResolution)
factor=2.54;
width=(size_t) (x_resolution*msl_info->image[n]->columns/
- (factor*(msl_info->image[n]->x_resolution == 0.0 ? DefaultResolution :
- msl_info->image[n]->x_resolution))+0.5);
+ (factor*(msl_info->image[n]->resolution.x == 0.0 ? DefaultResolution :
+ msl_info->image[n]->resolution.x))+0.5);
height=(size_t) (y_resolution*msl_info->image[n]->rows/
- (factor*(msl_info->image[n]->y_resolution == 0.0 ? DefaultResolution :
- msl_info->image[n]->y_resolution))+0.5);
+ (factor*(msl_info->image[n]->resolution.y == 0.0 ? DefaultResolution :
+ msl_info->image[n]->resolution.y))+0.5);
resample_image=ResizeImage(msl_info->image[n],width,height,
- msl_info->image[n]->filter,msl_info->image[n]->blur,
- msl_info->exception);
+ msl_info->image[n]->filter,msl_info->exception);
if (resample_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"resize") == 0)
{
- double
- blur;
-
- FilterTypes
+ FilterType
filter;
Image
break;
}
filter=UndefinedFilter;
- blur=1.0;
if (attributes != (const xmlChar **) NULL)
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
value);
- filter=(FilterTypes) option;
+ filter=(FilterType) option;
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseRegionGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword);
break;
}
- case 'S':
- case 's':
- {
- if (LocaleCompare(keyword,"support") == 0)
- {
- blur=InterpretLocaleValue(value,(char **) NULL);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",
- keyword);
- break;
- }
case 'W':
case 'w':
{
}
}
resize_image=ResizeImage(msl_info->image[n],geometry.width,
- geometry.height,filter,blur,msl_info->exception);
+ geometry.height,filter,msl_info->exception);
if (resize_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
break;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'D':
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- degrees = InterpretLocaleValue(value,(char **) NULL);
+ degrees = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseRegionGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
flags=ParseRegionGeometry(msl_info->image[n],value,
- &geometry,&exception);
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
geometry_info.rho=1.0;
geometry_info.sigma=1.5;
- colorspace=RGBColorspace;
+ colorspace=sRGBColorspace;
verbose=MagickFalse;
if (attributes != (const xmlChar **) NULL)
for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"cluster-threshold") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"smoothing-threshold") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
}
}
(void) SegmentImage(msl_info->image[n],colorspace,verbose,
- geometry_info.rho,geometry_info.sigma,&exception);
+ geometry_info.rho,geometry_info.sigma,exception);
break;
}
else if (LocaleCompare((const char *) tag, "set") == 0)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
*property;
property=GetImageProperty(msl_info->attributes[j],"id",
- &exception);
+ exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageMask(msl_info->image[n],msl_info->image[j],
- &exception);
+ SetImageMask(msl_info->image[n],ReadPixelMask,
+ msl_info->image[j],exception);
break;
}
}
*property;
property=GetImageProperty(msl_info->attributes[j],"id",
- &exception);
+ exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageClipMask(msl_info->image[n],msl_info->image[j],
- &exception);
+ SetImageMask(msl_info->image[n],ReadPixelMask,
+ msl_info->image[j],exception);
break;
}
}
ThrowMSLException(OptionError,"UnrecognizedColorspace",
value);
(void) TransformImageColorspace(msl_info->image[n],
- (ColorspaceType) colorspace,&exception);
+ (ColorspaceType) colorspace,exception);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
(void) SetImageProperty(msl_info->image[n],keyword,value,
- &exception);
+ exception);
break;
}
case 'D':
if (LocaleCompare(keyword,"density") == 0)
{
flags=ParseGeometry(value,&geometry_info);
- msl_info->image[n]->x_resolution=geometry_info.rho;
- msl_info->image[n]->y_resolution=geometry_info.sigma;
+ msl_info->image[n]->resolution.x=geometry_info.rho;
+ msl_info->image[n]->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
- msl_info->image[n]->y_resolution=
- msl_info->image[n]->x_resolution;
+ msl_info->image[n]->resolution.y=
+ msl_info->image[n]->resolution.x;
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
(void) SetImageProperty(msl_info->image[n],keyword,value,
- &exception);
+ exception);
break;
}
case 'O':
} else
opac = StringToLong( value );
(void) SetImageAlpha( msl_info->image[n], (Quantum) opac,
- &exception);
+ exception);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
if (LocaleCompare(keyword, "page") == 0)
{
char
- page[MaxTextExtent];
+ page[MagickPathExtent];
const char
*image_option;
geometry;
(void) ResetMagickMemory(&geometry,0,sizeof(geometry));
- image_option=GetImageOption(msl_info->image_info[n],"page");
+ image_option=GetImageArtifact(msl_info->image[n],"page");
if (image_option != (const char *) NULL)
flags=ParseAbsoluteGeometry(image_option,&geometry);
flags=ParseAbsoluteGeometry(value,&geometry);
- (void) FormatLocaleString(page,MaxTextExtent,"%.20gx%.20g",
+ (void) FormatLocaleString(page,MagickPathExtent,"%.20gx%.20g",
(double) geometry.width,(double) geometry.height);
if (((flags & XValue) != 0) || ((flags & YValue) != 0))
- (void) FormatLocaleString(page,MaxTextExtent,
+ (void) FormatLocaleString(page,MagickPathExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,
(double) geometry.height,(double) geometry.x,(double)
geometry.y);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"azimuth") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
{
if (LocaleCompare(keyword,"elevation") == 0)
{
- geometry_info.sigma=InterpretLocaleValue(value,
+ geometry_info.sigma=StringToDouble(value,
(char **) NULL);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.xi=InterpretLocaleValue(value,
+ geometry_info.xi=StringToDouble(value,
(char **) NULL);
break;
}
}
}
shadow_image=ShadowImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,(ssize_t) ceil(geometry_info.xi-0.5),(ssize_t)
- ceil(geometry_info.psi-0.5),msl_info->exception);
+ geometry_info.sigma,(ssize_t) ceil(geometry_info.xi-0.5),
+ (ssize_t) ceil(geometry_info.psi-0.5),msl_info->exception);
if (shadow_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"sharpen") == 0)
{
- double bias = 0.0,
+ double
radius = 0.0,
sigma = 1.0;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
- case 'B':
- case 'b':
- {
- if (LocaleCompare(keyword, "bias") == 0)
- {
- bias = InterpretLocaleValue(value,(char **) NULL);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
case 'R':
case 'r':
{
if (LocaleCompare(keyword, "radius") == 0)
{
- radius = InterpretLocaleValue(value,(char **) NULL);
+ radius = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=SharpenImage(msl_info->image[n],radius,sigma,bias,
+ newImage=SharpenImage(msl_info->image[n],radius,sigma,
msl_info->exception);
if (newImage == (Image *) NULL)
break;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
if (LocaleCompare(keyword, "fill") == 0)
{
(void) QueryColorCompliance(value,AllCompliance,
- &msl_info->image[n]->background_color,&exception);
+ &msl_info->image[n]->background_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SignatureImage(msl_info->image[n],&exception);
+ (void) SignatureImage(msl_info->image[n],exception);
break;
}
if (LocaleCompare((const char *) tag,"solarize") == 0)
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
}
}
}
- spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
- msl_info->image[n]->interpolate,msl_info->exception);
+ spread_image=SpreadImage(msl_info->image[n],
+ msl_info->image[n]->interpolate,geometry_info.rho,
+ msl_info->exception);
if (spread_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
else if (LocaleCompare((const char *) tag,"stegano") == 0)
{
Image *
- watermark = (Image*)NULL;
+ watermark = (Image*) NULL;
if (msl_info->image[n] == (Image *) NULL)
{
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'I':
{
const char *
theAttr = GetImageProperty(msl_info->attributes[j], "id",
- &exception);
+ exception);
if (theAttr && LocaleCompare(theAttr, value) == 0)
{
watermark = msl_info->image[j];
else if (LocaleCompare((const char *) tag,"stereo") == 0)
{
Image *
- stereoImage = (Image*)NULL;
+ stereoImage = (Image*) NULL;
if (msl_info->image[n] == (Image *) NULL)
{
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'I':
{
const char *
theAttr = GetImageProperty(msl_info->attributes[j], "id",
- &exception);
+ exception);
if (theAttr && LocaleCompare(theAttr, value) == 0)
{
stereoImage = msl_info->image[j];
} else
ThrowMSLException(OptionError,"Missing stereo image",keyword);
}
+ if (LocaleCompare((const char *) tag,"strip") == 0)
+ {
+ /*
+ Strip image.
+ */
+ if (msl_info->image[n] == (Image *) NULL)
+ {
+ ThrowMSLException(OptionError,"NoImagesDefined",
+ (const char *) tag);
+ break;
+ }
+ if (attributes != (const xmlChar **) NULL)
+ for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
+ {
+ keyword=(const char *) attributes[i++];
+ attribute=InterpretImageProperties(msl_info->image_info[n],
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
+ CloneString(&value,attribute);
+ ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+ }
+ (void) StripImage(msl_info->image[n],msl_info->exception);
+ break;
+ }
if (LocaleCompare((const char *) tag,"swap") == 0)
{
Image
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=InterpretLocaleValue(value,
+ geometry_info.rho=StringToDouble(value,
(char **) NULL);
break;
}
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SyncImage(msl_info->image[n],&exception);
+ (void) SyncImage(msl_info->image[n],exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
msl_info->attributes[n],(const char *) attributes[i],
- &exception);
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*attribute;
attribute=GetImageProperty(msl_info->attributes[j],"id",
- &exception);
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(attribute,value) == 0))
{
texture_image=CloneImage(msl_info->image[j],0,0,
- MagickFalse,&exception);
+ MagickFalse,exception);
break;
}
}
}
}
}
- (void) TextureImage(msl_info->image[n],texture_image,&exception);
+ (void) TextureImage(msl_info->image[n],texture_image,exception);
texture_image=DestroyImage(texture_image);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'T':
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- threshold = InterpretLocaleValue(value,(char **) NULL);
+ threshold = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
process image.
*/
{
- BilevelImage(msl_info->image[n],threshold,&exception);
+ BilevelImage(msl_info->image[n],threshold,exception);
break;
}
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
target;
(void) QueryColorCompliance(value,AllCompliance,&target,
- &exception);
+ exception);
(void) TransparentPaintImage(msl_info->image[n],&target,
TransparentAlpha,MagickFalse,msl_info->exception);
break;
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i],&exception));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'F':
if (LocaleCompare(keyword,"filename") == 0)
{
(void) CopyMagickString(msl_info->image[n]->filename,value,
- MaxTextExtent);
+ MagickPathExtent);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
/* process */
{
+ *msl_info->image_info[n]->magick='\0';
(void) WriteImage(msl_info->image_info[n], msl_info->image[n],
msl_info->exception);
break;
}
if ( value != NULL )
value=DestroyString(value);
+ (void) DestroyExceptionInfo(exception);
(void) LogMagickEvent(CoderEvent,GetMagickModule()," )");
}
msl_info=(MSLInfo *) context;
if (msl_info->content != (char *) NULL)
msl_info->content=(char *) ResizeQuantumMemory(msl_info->content,
- strlen(msl_info->content)+length+MaxTextExtent,
+ strlen(msl_info->content)+length+MagickPathExtent,
sizeof(*msl_info->content));
else
{
msl_info->content=(char *) NULL;
- if (~length >= (MaxTextExtent-1))
- msl_info->content=(char *) AcquireQuantumMemory(length+MaxTextExtent,
+ if (~length >= (MagickPathExtent-1))
+ msl_info->content=(char *) AcquireQuantumMemory(length+MagickPathExtent,
sizeof(*msl_info->content));
if (msl_info->content != (char *) NULL)
*msl_info->content='\0';
{
char
*message,
- reason[MaxTextExtent];
+ reason[MagickPathExtent];
MSLInfo
*msl_info;
#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsprintf(reason,format,operands);
#else
- (void) vsnprintf(reason,MaxTextExtent,format,operands);
+ (void) vsnprintf(reason,MagickPathExtent,format,operands);
#endif
message=GetExceptionMessage(errno);
ThrowMSLException(CoderError,reason,message);
static void MSLError(void *context,const char *format,...)
{
char
- reason[MaxTextExtent];
+ reason[MagickPathExtent];
MSLInfo
*msl_info;
#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsprintf(reason,format,operands);
#else
- (void) vsnprintf(reason,MaxTextExtent,format,operands);
+ (void) vsnprintf(reason,MagickPathExtent,format,operands);
#endif
ThrowMSLException(DelegateFatalError,reason,"SAX error");
va_end(operands);
}
#endif
-static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **image,
- ExceptionInfo *exception)
+static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,
+ Image **image,ExceptionInfo *exception)
{
char
- message[MaxTextExtent];
+ message[MagickPathExtent];
Image
*msl_image;
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
(void) xmlParseChunk(msl_info.parser," ",1,MagickTrue);
xmlFreeParserCtxt(msl_info.parser);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),"end SAX");
- xmlCleanupParser();
msl_info.group_info=(MSLGroupInfo *) RelinquishMagickMemory(
msl_info.group_info);
if (*image == (Image *) NULL)
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
- assert(exception->signature == MagickSignature);
+ assert(exception->signature == MagickCoreSignature);
image=(Image *) NULL;
(void) ProcessMSLScript(image_info,&image,exception);
return(GetFirstImageInList(image));
MagickInfo
*entry;
- entry=SetMagickInfo("MSL");
+#if defined(MAGICKCORE_XML_DELEGATE)
+ xmlInitParser();
+#endif
+ entry=AcquireMagickInfo("MSL","MSL","Magick Scripting Language");
#if defined(MAGICKCORE_XML_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadMSLImage;
entry->encoder=(EncodeImageHandler *) WriteMSLImage;
#endif
- entry->description=ConstantString("Magick Scripting Language");
- entry->module=ConstantString("MSL");
+ entry->format_type=ImplicitFormatType;
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
ssize_t
alpha;
- alpha=ParseCommandOption(MagickAlphaOptions,MagickFalse,value);
+ alpha=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,value);
if (alpha < 0)
ThrowMSLException(OptionError,"UnrecognizedType",value);
if (image != (Image *) NULL)
- (void) SetImageAlphaChannel(image,(AlphaChannelType) alpha,
+ (void) SetImageAlphaChannel(image,(AlphaChannelOption) alpha,
exception);
break;
}
+ if (LocaleCompare(keyword,"alpha-color") == 0)
+ {
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->alpha_color,exception);
+ break;
+ }
if (LocaleCompare(keyword,"antialias") == 0)
{
ssize_t
limit=MagickResourceInfinity;
if (LocaleCompare(value,"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(value,100.0);
+ limit=(MagickSizeType) StringToDoubleInterval(value,100.0);
(void) SetMagickResourceLimit(AreaResource,limit);
break;
}
&image_info->background_color,exception);
break;
}
- if (LocaleCompare(keyword,"bias") == 0)
- {
- if (image == (Image *) NULL)
- break;
- image->bias=SiPrefixToDouble(value,QuantumRange);
- break;
- }
if (LocaleCompare(keyword,"blue-primary") == 0)
{
if (image == (Image *) NULL)
}
if (LocaleCompare(keyword,"filename") == 0)
{
- (void) CopyMagickString(image_info->filename,value,MaxTextExtent);
+ (void) CopyMagickString(image_info->filename,value,MagickPathExtent);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"magick") == 0)
{
- (void) CopyMagickString(image_info->magick,value,MaxTextExtent);
- break;
- }
- if (LocaleCompare(keyword,"mattecolor") == 0)
- {
- (void) QueryColorCompliance(value,AllCompliance,
- &image_info->matte_color,exception);
+ (void) CopyMagickString(image_info->magick,value,MagickPathExtent);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- image_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
- draw_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
+ image_info->pointsize=StringToDouble(value,(char **) NULL);
+ draw_info->pointsize=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
ModuleExport void UnregisterMSLImage(void)
{
(void) UnregisterMagickInfo("MSL");
+#if defined(MAGICKCORE_XML_DELEGATE)
+ xmlCleanupParser();
+#endif
}
\f
#if defined(MAGICKCORE_XML_DELEGATE)
ExceptionInfo *exception)
{
assert(image_info != (const ImageInfo *) NULL);
- assert(image_info->signature == MagickSignature);
+ assert(image_info->signature == MagickCoreSignature);
assert(image != (Image *) NULL);
- assert(image->signature == MagickSignature);
+ assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
(void) ReferenceImage(image);