% Execute Magick Scripting Language Scripts. %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% Leonard Rosenthol %
% William Radcliffe %
% December 2001 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2015 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 declarations.
*/
-#include "magick/studio.h"
-#include "magick/annotate.h"
-#include "magick/artifact.h"
-#include "magick/blob.h"
-#include "magick/blob-private.h"
-#include "magick/cache.h"
-#include "magick/cache-view.h"
-#include "magick/color.h"
-#include "magick/colormap.h"
-#include "magick/color-private.h"
-#include "magick/composite.h"
-#include "magick/constitute.h"
-#include "magick/decorate.h"
-#include "magick/display.h"
-#include "magick/draw.h"
-#include "magick/effect.h"
-#include "magick/enhance.h"
-#include "magick/exception.h"
-#include "magick/exception-private.h"
-#include "magick/fx.h"
-#include "magick/geometry.h"
-#include "magick/image.h"
-#include "magick/image-private.h"
-#include "magick/list.h"
-#include "magick/log.h"
-#include "magick/magick.h"
-#include "magick/memory_.h"
-#include "magick/module.h"
-#include "magick/option.h"
-#include "magick/paint.h"
-#include "magick/profile.h"
-#include "magick/property.h"
-#include "magick/quantize.h"
-#include "magick/quantum-private.h"
-#include "magick/registry.h"
-#include "magick/resize.h"
-#include "magick/resource_.h"
-#include "magick/segment.h"
-#include "magick/shear.h"
-#include "magick/signature.h"
-#include "magick/static.h"
-#include "magick/string_.h"
-#include "magick/string-private.h"
-#include "magick/transform.h"
-#include "magick/threshold.h"
-#include "magick/utility.h"
+#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/composite.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/exception.h"
+#include "MagickCore/exception-private.h"
+#include "MagickCore/fx.h"
+#include "MagickCore/geometry.h"
+#include "MagickCore/image.h"
+#include "MagickCore/image-private.h"
+#include "MagickCore/list.h"
+#include "MagickCore/log.h"
+#include "MagickCore/magick.h"
+#include "MagickCore/memory_.h"
+#include "MagickCore/module.h"
+#include "MagickCore/option.h"
+#include "MagickCore/paint.h"
+#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/profile.h"
+#include "MagickCore/property.h"
+#include "MagickCore/quantize.h"
+#include "MagickCore/quantum-private.h"
+#include "MagickCore/registry.h"
+#include "MagickCore/resize.h"
+#include "MagickCore/resource_.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/transform.h"
+#include "MagickCore/threshold.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
*/
#if defined(MAGICKCORE_XML_DELEGATE)
static MagickBooleanType
- WriteMSLImage(const ImageInfo *,Image *);
+ WriteMSLImage(const ImageInfo *,Image *,ExceptionInfo *);
static MagickBooleanType
SetMSLAttributes(MSLInfo *,const char *,const char *);
ImageInfo
*read_info;
- (void) FormatMagickString(key,MaxTextExtent,"cache:%s",path);
+ (void) FormatLocaleString(key,MaxTextExtent,"cache:%s",path);
sans_exception=AcquireExceptionInfo();
image=(Image *) GetImageRegistry(ImageRegistryType,key,sans_exception);
sans_exception=DestroyExceptionInfo(sans_exception);
" SAX.setDocumentLocator()\n");
(void) location;
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLStartDocument(void *context)
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]);
if (image == (Image *) NULL)
- msl_info->attributes[n]=AcquireImage(msl_info->image_info[n]);
+ msl_info->attributes[n]=AcquireImage(msl_info->image_info[n],
+ msl_info->exception);
else
- msl_info->attributes[n]=CloneImage(image,0,0,MagickTrue,&image->exception);
+ msl_info->attributes[n]=CloneImage(image,0,0,MagickTrue,
+ 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++;
}
ChannelType
channel;
+ ChannelType
+ channel_mask;
+
char
key[MaxTextExtent],
*value;
*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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"noise") == 0)
{
- option=ParseMagickOption(MagickNoiseOptions,MagickFalse,
+ option=ParseCommandOption(MagickNoiseOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
}
}
}
- noise_image=AddNoiseImageChannel(msl_info->image[n],channel,noise,
- &msl_info->image[n]->exception);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
+ noise_image=AddNoiseImage(msl_info->image[n],noise,1.0,
+ msl_info->exception);
+ (void) SetPixelChannelMask(msl_info->image[n],channel_mask);
if (noise_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=strtod(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=strtod(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=strtod(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=strtod(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=strtod(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=strtod(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
{
- option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+ option=ParseCommandOption(MagickAlignOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedAlignType",
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickBooleanOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"family") == 0)
{
if (LocaleCompare(keyword,"geometry") == 0)
{
- flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
- if ((flags & HeightValue) == 0)
- geometry.height=geometry.width;
+ flags=ParseGravityGeometry(msl_info->image[n],value,
+ &geometry,exception);
break;
}
if (LocaleCompare(keyword,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickGravityOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
value);
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=StringToDouble(value);
+ draw_info->pointsize=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=StringToDouble(value);
+ 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=StringToDouble(value);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=StringToDouble(value);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=tan(DegreesToRadians(fmod((double) angle,
360.0)));
break;
}
if (LocaleCompare(keyword,"stretch") == 0)
{
- option=ParseMagickOption(MagickStretchOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickStretchOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStretchType",
value);
}
if (LocaleCompare(keyword, "stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
}
if (LocaleCompare(keyword,"style") == 0)
{
- option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+ option=ParseCommandOption(MagickStyleOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStyleType",
{
if (LocaleCompare(keyword, "undercolor") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->undercolor,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
- draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
- draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
- draw_info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
- draw_info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
- draw_info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- draw_info->affine.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
- (void) AnnotateImage(msl_info->image[n],draw_info);
+ draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
+ draw_info->affine.rx=affine.rx*current.sx+affine.sy*current.rx;
+ draw_info->affine.ry=affine.sx*current.ry+affine.ry*current.sy;
+ draw_info->affine.sy=affine.rx*current.ry+affine.sy*current.sy;
+ draw_info->affine.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
+ (void) AnnotateImage(msl_info->image[n],draw_info,
+ msl_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"stack") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
}
}
append_image=AppendImages(msl_info->image[n],stack,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (append_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- blur_image=BlurImageChannel(msl_info->image[n],channel,
- geometry_info.rho,geometry_info.sigma,
- &msl_info->image[n]->exception);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
+ blur_image=BlurImage(msl_info->image[n],geometry_info.rho,
+ 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"compose") == 0)
{
- option=ParseMagickOption(MagickComposeOptions,MagickFalse,
+ option=ParseCommandOption(MagickComposeOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedComposeType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,
- &msl_info->image[n]->border_color,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &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;
}
}
border_image=BorderImage(msl_info->image[n],&geometry,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->compose,msl_info->exception);
if (border_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
if (LocaleCompare((const char *) tag,"colorize") == 0)
{
char
- opacity[MaxTextExtent];
+ blend[MaxTextExtent];
Image
*colorize_image;
- PixelPacket
+ PixelInfo
target;
/*
(const char *) tag);
break;
}
- target=msl_info->image[n]->background_color;
- (void) CopyMagickString(opacity,"100",MaxTextExtent);
+ GetPixelInfo(msl_info->image[n],&target);
+ (void) CopyMagickString(blend,"100",MaxTextExtent);
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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
- case 'F':
- case 'f':
+ case 'B':
+ case 'b':
{
- if (LocaleCompare(keyword,"fill") == 0)
+ if (LocaleCompare(keyword,"blend") == 0)
{
- (void) QueryColorDatabase(value,&target,
- &msl_info->image[n]->exception);
+ (void) CopyMagickString(blend,value,MaxTextExtent);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
keyword);
break;
}
- case 'O':
- case 'o':
+ case 'F':
+ case 'f':
{
- if (LocaleCompare(keyword,"opacity") == 0)
+ if (LocaleCompare(keyword,"fill") == 0)
{
- (void) CopyMagickString(opacity,value,MaxTextExtent);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &target,msl_info->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- colorize_image=ColorizeImage(msl_info->image[n],opacity,target,
- &msl_info->image[n]->exception);
+ colorize_image=ColorizeImage(msl_info->image[n],blend,&target,
+ msl_info->exception);
if (colorize_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag, "charcoal") == 0)
{
- double radius = 0.0,
+ double
+ radius = 0.0,
sigma = 1.0;
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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'R':
case 'r':
{
- if (LocaleCompare(keyword, "radius") == 0)
+ if (LocaleCompare(keyword,"radius") == 0)
{
- radius = StringToDouble( value );
+ radius=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
*newImage;
newImage=CharcoalImage(msl_info->image[n],radius,sigma,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (newImage == (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ 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;
}
}
chop_image=ChopImage(msl_info->image[n],&geometry,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (chop_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
PaintMethod
paint_method;
- MagickPixelPacket
+ PixelInfo
target;
/*
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
- (void) QueryMagickColor(value,&target,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &target,exception);
paint_method=FillToBorderMethod;
break;
}
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->fill,exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=StringToDouble(value);
+ msl_info->image[n]->fuzz=StringToDouble(value,
+ (char **) NULL);
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;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FloodfillPaintImage(msl_info->image[n],DefaultChannels,
- draw_info,&target,geometry.x,geometry.y,
- paint_method == FloodfillMethod ? MagickFalse : MagickTrue);
+ (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target,
+ geometry.x,geometry.y,paint_method == FloodfillMethod ?
+ MagickFalse : MagickTrue,msl_info->exception);
draw_info=DestroyDrawInfo(draw_info);
break;
}
*composite_image,
*rotate_image;
- PixelPacket
- target;
-
/*
Composite image.
*/
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"compose") == 0)
{
- option=ParseMagickOption(MagickComposeOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickComposeOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedComposeType",
value);
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
if (LocaleCompare(keyword, "color") == 0)
{
- (void) QueryColorDatabase(value,
- &composite_image->background_color,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &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;
- (void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
- geometry.y,&target,&exception);
break;
}
if (LocaleCompare(keyword,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickGravityOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
value);
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if ((attribute != (const char *) NULL) &&
(LocaleCompare(value,value) == 0))
{
- SetImageType(composite_image,TrueColorMatteType);
+ SetImageType(composite_image,TrueColorMatteType,
+ exception);
(void) CompositeImage(composite_image,
- CopyOpacityCompositeOp,msl_info->image[j],0,0);
+ msl_info->image[j],CopyAlphaCompositeOp,MagickTrue,
+ 0,0,exception);
break;
}
}
register ssize_t
x;
- register PixelPacket
+ register Quantum
*q;
CacheView
*composite_view;
- opacity=QuantumRange-StringToLong(value);
+ opacity=StringToLong(value);
if (compose != DissolveCompositeOp)
{
- (void) SetImageOpacity(composite_image,(Quantum)
- opacity);
+ (void) SetImageAlpha(composite_image,(Quantum)
+ opacity,exception);
break;
}
(void) SetImageArtifact(msl_info->image[n],
"compose:args",value);
- if (composite_image->matte != MagickTrue)
- (void) SetImageOpacity(composite_image,OpaqueOpacity);
- composite_view=AcquireCacheView(composite_image);
+ if (composite_image->alpha_trait != BlendPixelTrait)
+ (void) SetImageAlpha(composite_image,OpaqueAlpha,
+ 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);
+ q=GetCacheViewAuthenticPixels(composite_view,0,y,
+ (ssize_t) composite_image->columns,1,exception);
for (x=0; x < (ssize_t) composite_image->columns; x++)
{
- if (q->opacity == OpaqueOpacity)
- q->opacity=ClampToQuantum(opacity);
- q++;
+ if (GetPixelAlpha(composite_image,q) == OpaqueAlpha)
+ SetPixelAlpha(composite_image,
+ 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,StringToDouble(value),
- &exception);
+ rotate_image=RotateImage(composite_image,
+ StringToDouble(value,(char **) NULL),exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
MagickBooleanType
tile;
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
value);
tile=(MagickBooleanType) option;
+ (void) tile;
if (rotate_image != (Image *) NULL)
(void) SetImageArtifact(rotate_image,
"compose:outside-overlay","false");
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);
+ (void) CompositeImage(image,rotate_image,compose,
+ MagickTrue,x,y,exception);
else
- (void) CompositeImage(image,compose,
- composite_image,x,y);
+ (void) CompositeImage(image,composite_image,
+ compose,MagickTrue,x,y,exception);
}
if (rotate_image != (Image *) NULL)
rotate_image=DestroyImage(rotate_image);
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
- geometry.y,&target,&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
- geometry.y,&target,&exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
image=msl_info->image[n];
- (void) FormatMagickString(composite_geometry,MaxTextExtent,
+ (void) FormatLocaleString(composite_geometry,MaxTextExtent,
"%.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);
+ exception);
+ channel_mask=SetImageChannelMask(image,channel);
if (rotate_image == (Image *) NULL)
- CompositeImageChannel(image,channel,compose,composite_image,
- geometry.x,geometry.y);
+ CompositeImage(image,composite_image,compose,MagickTrue,geometry.x,
+ geometry.y,exception);
else
{
/*
*/
geometry.x-=(ssize_t) (rotate_image->columns-
composite_image->columns)/2;
- geometry.y-=(ssize_t) (rotate_image->rows-composite_image->rows)/2;
- CompositeImageChannel(image,channel,compose,rotate_image,
- geometry.x,geometry.y);
+ geometry.y-=(ssize_t) (rotate_image->rows-
+ composite_image->rows)/2;
+ CompositeImage(image,rotate_image,compose,MagickTrue,geometry.x,
+ geometry.y,exception);
rotate_image=DestroyImage(rotate_image);
}
+ (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"sharpen") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
}
}
}
- (void) ContrastImage(msl_info->image[n],sharpen);
+ (void) ContrastImage(msl_info->image[n],sharpen,
+ msl_info->exception);
break;
}
if (LocaleCompare((const char *) tag,"crop") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"geometry") == 0)
{
- flags=ParsePageGeometry(msl_info->image[n],value,
- &geometry,&exception);
- if ((flags & HeightValue) == 0)
- geometry.height=geometry.width;
+ flags=ParseGravityGeometry(msl_info->image[n],value,
+ &geometry,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
crop_image=CropImage(msl_info->image[n],&geometry,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (crop_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) CycleColormapImage(msl_info->image[n],display);
+ (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
despeckle_image=DespeckleImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (despeckle_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) DisplayImages(msl_info->image_info[n],msl_info->image[n]);
+ (void) DisplayImages(msl_info->image_info[n],msl_info->image[n],
+ msl_info->exception);
break;
}
if (LocaleCompare((const char *) tag,"draw") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=strtod(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=strtod(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=strtod(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=strtod(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=strtod(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=strtod(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
{
- option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+ option=ParseCommandOption(MagickAlignOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedAlignType",
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &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,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+ option=ParseCommandOption(MagickGravityOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
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=StringToDouble(value);
+ draw_info->pointsize=StringToDouble(value,
+ (char **) NULL);
+ break;
+ }
+ if (LocaleCompare(keyword,"primitive") == 0)
+ {
+ CloneString(&draw_info->primitive,value);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=StringToDouble(value);
+ 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=StringToDouble(value);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=StringToDouble(value);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"stretch") == 0)
{
- option=ParseMagickOption(MagickStretchOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickStretchOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStretchType",
value);
}
if (LocaleCompare(keyword, "stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
}
if (LocaleCompare(keyword,"style") == 0)
{
- option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+ option=ParseCommandOption(MagickStyleOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStyleType",
{
if (LocaleCompare(keyword, "undercolor") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->undercolor,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
- draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
- draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
- draw_info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
- draw_info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
- draw_info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- draw_info->affine.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
- (void) DrawImage(msl_info->image[n],draw_info);
+ draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
+ draw_info->affine.rx=affine.rx*current.sx+affine.sy*current.rx;
+ draw_info->affine.ry=affine.sx*current.ry+affine.ry*current.sy;
+ draw_info->affine.sy=affine.rx*current.ry+affine.sy*current.sy;
+ draw_info->affine.tx=affine.sx*current.tx+affine.ry*current.ty+
+ 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);
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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
edge_image=EdgeImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
emboss_image=EmbossImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (emboss_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
enhance_image=EnhanceImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (enhance_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) EqualizeImage(msl_info->image[n]);
+ (void) EqualizeImage(msl_info->image[n],
+ msl_info->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
*newImage;
newImage=MergeImageLayers(msl_info->image[n],FlattenLayer,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (newImage == (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
flip_image=FlipImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (flip_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
flop_image=FlopImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (flop_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
(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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"compose") == 0)
{
- option=ParseMagickOption(MagickComposeOptions,
+ option=ParseCommandOption(MagickComposeOptions,
MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedComposeType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,
- &msl_info->image[n]->matte_color,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &msl_info->image[n]->matte_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;
frame_info.width=msl_info->image[n]->columns+2*frame_info.x;
frame_info.height=msl_info->image[n]->rows+2*frame_info.y;
frame_image=FrameImage(msl_info->image[n],&frame_info,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->compose,msl_info->exception);
if (frame_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
char
gamma[MaxTextExtent];
- MagickPixelPacket
+ PixelInfo
pixel;
/*
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blue") == 0)
{
- pixel.blue=StringToDouble(value);
+ pixel.blue=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare(keyword,"green") == 0)
{
- pixel.green=StringToDouble(value);
+ pixel.green=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"red") == 0)
{
- pixel.red=StringToDouble(value);
+ pixel.red=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
if (*gamma == '\0')
- (void) FormatMagickString(gamma,MaxTextExtent,"%g,%g,%g",
+ (void) FormatLocaleString(gamma,MaxTextExtent,"%g,%g,%g",
(double) pixel.red,(double) pixel.green,(double) pixel.blue);
- switch (channel)
- {
- default:
- {
- (void) GammaImage(msl_info->image[n],gamma);
- break;
- }
- case RedChannel:
- {
- (void) GammaImageChannel(msl_info->image[n],RedChannel,pixel.red);
- break;
- }
- case GreenChannel:
- {
- (void) GammaImageChannel(msl_info->image[n],GreenChannel,
- pixel.green);
- break;
- }
- case BlueChannel:
- {
- (void) GammaImageChannel(msl_info->image[n],BlueChannel,
- pixel.blue);
- break;
- }
- }
+ (void) GammaImage(msl_info->image[n],atof(gamma),
+ msl_info->exception);
break;
}
else if (LocaleCompare((const char *) tag,"get") == 0)
{
if (LocaleCompare(keyword,"height") == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
(double) msl_info->image[n]->rows);
- (void) SetImageProperty(msl_info->attributes[n],key,value);
+ (void) SetImageProperty(msl_info->attributes[n],key,value,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"width") == 0)
{
- (void) FormatMagickString(value,MaxTextExtent,"%.20g",
+ (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
(double) msl_info->image[n]->columns);
- (void) SetImageProperty(msl_info->attributes[n],key,value);
+ (void) SetImageProperty(msl_info->attributes[n],key,value,
+ 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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
"xc:",MaxTextExtent);
(void) ConcatenateMagickString(msl_info->image_info[n]->
filename,value,MaxTextExtent);
- next_image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
+ 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"amount") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
implode_image=ImplodeImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,msl_info->exception);
if (implode_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
if (LocaleCompare(keyword,"black") == 0)
{
- levelBlack = StringToDouble( value );
+ levelBlack = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"gamma") == 0)
{
- levelGamma = StringToDouble( value );
+ levelGamma = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"white") == 0)
{
- levelWhite = StringToDouble( value );
+ levelWhite = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
/* process image */
- {
- char level[MaxTextExtent + 1];
- (void) FormatMagickString(level,MaxTextExtent,"%3.6f/%3.6f/%3.6f/",
- levelBlack,levelGamma,levelWhite);
- LevelImage ( msl_info->image[n], level );
- break;
- }
+ LevelImage(msl_info->image[n],levelBlack,levelWhite,levelGamma,
+ msl_info->exception);
+ break;
}
}
case 'M':
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
magnify_image=MagnifyImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (magnify_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"dither") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ 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);
+ affinity_image,exception);
quantize_info=DestroyQuantizeInfo(quantize_info);
affinity_image=DestroyImage(affinity_image);
break;
double
opacity;
- MagickPixelPacket
+ PixelInfo
target;
PaintMethod
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"bordercolor") == 0)
{
- (void) QueryMagickColor(value,&target,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &target,exception);
paint_method=FillToBorderMethod;
break;
}
{
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=StringToDouble(value);
+ msl_info->image[n]->fuzz=StringToDouble(value,
+ (char **) NULL);
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;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"opacity") == 0)
{
- opacity=StringToDouble(value);
+ opacity=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
draw_info=CloneDrawInfo(msl_info->image_info[n],
msl_info->draw_info[n]);
- draw_info->fill.opacity=ClampToQuantum(opacity);
- (void) FloodfillPaintImage(msl_info->image[n],OpacityChannel,
- draw_info,&target,geometry.x,geometry.y,
- paint_method == FloodfillMethod ? MagickFalse : MagickTrue);
+ draw_info->fill.alpha=ClampToQuantum(opacity);
+ 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) 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- median_image=MedianFilterImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ median_image=StatisticImage(msl_info->image[n],MedianStatistic,
+ (size_t) geometry_info.rho,(size_t) geometry_info.sigma,
+ msl_info->exception);
if (median_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
minify_image=MinifyImage(msl_info->image[n],
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (minify_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"blackness") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
if (LocaleCompare(keyword,"brightness") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"hue") == 0)
{
- geometry_info.xi=StringToDouble(value);
+ geometry_info.xi=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"lightness") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"saturation") == 0)
{
- geometry_info.sigma=StringToDouble(value);
+ geometry_info.sigma=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"whiteness") == 0)
{
- geometry_info.sigma=StringToDouble(value);
+ geometry_info.sigma=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(modulate,MaxTextExtent,"%g,%g,%g",
+ (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g",
geometry_info.rho,geometry_info.sigma,geometry_info.xi);
- (void) ModulateImage(msl_info->image[n],modulate);
+ (void) ModulateImage(msl_info->image[n],modulate,
+ msl_info->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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"gray") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
}
}
}
- (void) NegateImageChannel(msl_info->image[n],channel,gray);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
+ (void) NegateImage(msl_info->image[n],gray,
+ msl_info->exception);
+ (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) NormalizeImageChannel(msl_info->image[n],channel);
+ (void) NormalizeImage(msl_info->image[n],
+ msl_info->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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
paint_image=OilPaintImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (paint_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
if (LocaleCompare((const char *) tag,"opaque") == 0)
{
- MagickPixelPacket
+ PixelInfo
fill_color,
target;
(const char *) tag);
break;
}
- (void) QueryMagickColor("none",&target,&exception);
- (void) QueryMagickColor("none",&fill_color,&exception);
+ (void) QueryColorCompliance("none",AllCompliance,&target,
+ exception);
+ (void) QueryColorCompliance("none",AllCompliance,&fill_color,
+ 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryMagickColor(value,&fill_color,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &fill_color,exception);
break;
}
if (LocaleCompare(keyword,"fuzz") == 0)
{
- msl_info->image[n]->fuzz=StringToDouble(value);
+ msl_info->image[n]->fuzz=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) OpaquePaintImageChannel(msl_info->image[n],channel,
- &target,&fill_color,MagickFalse);
+ channel_mask=SetImageChannelMask(msl_info->image[n],channel);
+ (void) OpaquePaintImage(msl_info->image[n],&target,&fill_color,
+ MagickFalse,msl_info->exception);
+ (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"output") == 0)
{
- (void) fprintf(stdout,"%s",value);
+ (void) FormatLocaleFile(stdout,"%s",value);
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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ 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,MagickTrue);
+ (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)
{
*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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
if (LocaleCompare(keyword,"colorspace") == 0)
{
- option=ParseMagickOption(MagickColorspaceOptions,
+ option=ParseCommandOption(MagickColorspaceOptions,
MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,
{
if (LocaleCompare(keyword,"dither") == 0)
{
- option=ParseMagickOption(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",
{
if (LocaleCompare(keyword,"measure") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
}
}
}
- (void) QuantizeImage(&quantize_info,msl_info->image[n]);
+ (void) QuantizeImage(&quantize_info,msl_info->image[n],exception);
break;
}
if (LocaleCompare((const char *) tag,"query-font-metrics") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
*p;
p=value;
- draw_info->affine.sx=strtod(p,&p);
+ draw_info->affine.sx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.rx=strtod(p,&p);
+ draw_info->affine.rx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ry=strtod(p,&p);
+ draw_info->affine.ry=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.sy=strtod(p,&p);
+ draw_info->affine.sy=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.tx=strtod(p,&p);
+ draw_info->affine.tx=StringToDouble(p,&p);
if (*p ==',')
p++;
- draw_info->affine.ty=strtod(p,&p);
+ draw_info->affine.ty=StringToDouble(p,&p);
break;
}
if (LocaleCompare(keyword,"align") == 0)
{
- option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+ option=ParseCommandOption(MagickAlignOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedAlignType",
}
if (LocaleCompare(keyword,"antialias") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedBooleanType",
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &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,"gravity") == 0)
{
- option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+ option=ParseCommandOption(MagickGravityOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- draw_info->pointsize=StringToDouble(value);
+ draw_info->pointsize=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"rotate") == 0)
{
- angle=StringToDouble(value);
+ 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=StringToDouble(value);
+ angle=StringToDouble(value,(char **) NULL);
affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"skewY") == 0)
{
- angle=StringToDouble(value);
+ angle=StringToDouble(value,(char **) NULL);
affine.rx=cos(DegreesToRadians(fmod(angle,360.0)));
break;
}
if (LocaleCompare(keyword,"stretch") == 0)
{
- option=ParseMagickOption(MagickStretchOptions,MagickFalse,
- value);
+ option=ParseCommandOption(MagickStretchOptions,
+ MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStretchType",
value);
}
if (LocaleCompare(keyword, "stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->stroke,exception);
break;
}
if (LocaleCompare(keyword,"strokewidth") == 0)
}
if (LocaleCompare(keyword,"style") == 0)
{
- option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+ option=ParseCommandOption(MagickStyleOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedStyleType",
{
if (LocaleCompare(keyword, "undercolor") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->undercolor,
- &exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &draw_info->undercolor,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) FormatMagickString(text,MaxTextExtent,
+ (void) FormatLocaleString(text,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
geometry.height,(double) geometry.x,(double) geometry.y);
CloneString(&draw_info->geometry,text);
- draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
- draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
- draw_info->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
- draw_info->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
- draw_info->affine.tx=current.sx*affine.tx+current.ry*affine.ty+
- current.tx;
- draw_info->affine.ty=current.rx*affine.tx+current.sy*affine.ty+
- current.ty;
- status=GetTypeMetrics(msl_info->attributes[n],draw_info,&metrics);
+ draw_info->affine.sx=affine.sx*current.sx+affine.ry*current.rx;
+ draw_info->affine.rx=affine.rx*current.sx+affine.sy*current.rx;
+ draw_info->affine.ry=affine.sx*current.ry+affine.ry*current.sy;
+ draw_info->affine.sy=affine.rx*current.ry+affine.sy*current.sy;
+ draw_info->affine.tx=affine.sx*current.tx+affine.ry*current.ty+
+ affine.tx;
+ draw_info->affine.ty=affine.rx*current.tx+affine.sy*current.ty+
+ affine.ty;
+ status=GetTypeMetrics(msl_info->attributes[n],draw_info,&metrics,
+ msl_info->exception);
if (status != MagickFalse)
{
Image
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ 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;
{
if (LocaleCompare(keyword,"raise") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
}
}
}
- (void) RaiseImage(msl_info->image[n],&geometry,raise);
+ (void) RaiseImage(msl_info->image[n],&geometry,raise,
+ msl_info->exception);
break;
}
if (LocaleCompare((const char *) tag,"read") == 0)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'F':
(void) CopyMagickString(msl_info->image_info[n]->filename,
value,MaxTextExtent);
- image=ReadImage(msl_info->image_info[n],&exception);
- CatchException(&exception);
+ 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- paint_image=ReduceNoiseImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ paint_image=StatisticImage(msl_info->image[n],NonpeakStatistic,
+ (size_t) geometry_info.rho,(size_t) geometry_info.sigma,
+ msl_info->exception);
if (paint_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ 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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
- case 'b':
- {
- if (LocaleCompare(keyword,"blur") == 0)
- {
- msl_info->image[n]->blur=StringToDouble(value);
- break;
- }
- ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
- break;
- }
case 'G':
case 'g':
{
{
if (LocaleCompare(keyword,"x-resolution") == 0)
{
- x_resolution=StringToDouble(value);
+ x_resolution=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"y-resolution") == 0)
{
- y_resolution=StringToDouble(value);
+ 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->image[n]->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
filter;
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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"filter") == 0)
{
- option=ParseMagickOption(MagickFilterOptions,MagickFalse,
+ option=ParseCommandOption(MagickFilterOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
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=StringToDouble(value);
- 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->image[n]->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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ 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;
}
}
roll_image=RollImage(msl_info->image[n],geometry.x,geometry.y,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (roll_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
Image
*newImage;
- newImage=RollImage(msl_info->image[n], x, y, &msl_info->image[n]->exception);
+ newImage=RollImage(msl_info->image[n], x, y, msl_info->exception);
if (newImage == (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
rotate_image=RotateImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (rotate_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'D':
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- degrees = StringToDouble( value );
+ degrees = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=RotateImage(msl_info->image[n], degrees, &msl_info->image[n]->exception);
+ newImage=RotateImage(msl_info->image[n], degrees, msl_info->exception);
if (newImage == (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ 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",
}
}
sample_image=SampleImage(msl_info->image[n],geometry.width,
- geometry.height,&msl_info->image[n]->exception);
+ geometry.height,msl_info->exception);
if (sample_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ 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",
}
}
scale_image=ScaleImage(msl_info->image[n],geometry.width,
- geometry.height,&msl_info->image[n]->exception);
+ geometry.height,msl_info->exception);
if (scale_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
}
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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"cluster-threshold") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
if (LocaleCompare(keyword,"colorspace") == 0)
{
- option=ParseMagickOption(MagickColorspaceOptions,
+ option=ParseCommandOption(MagickColorspaceOptions,
MagickFalse,value);
if (option < 0)
ThrowMSLException(OptionError,
{
if (LocaleCompare(keyword,"smoothing-threshold") == 0)
{
- geometry_info.sigma=StringToDouble(value);
+ geometry_info.sigma=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
(void) SegmentImage(msl_info->image[n],colorspace,verbose,
- geometry_info.rho,geometry_info.sigma);
+ geometry_info.rho,geometry_info.sigma,exception);
break;
}
else if (LocaleCompare((const char *) tag, "set") == 0)
{
if (msl_info->image[n] == (Image *) NULL)
{
- ThrowMSLException(OptionError,"NoImagesDefined",
- (const char *) tag);
+ ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
break;
}
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
const char
*property;
- property=GetImageProperty(msl_info->attributes[j],"id");
+ property=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageMask(msl_info->image[n],msl_info->image[j]);
+ SetImageMask(msl_info->image[n],msl_info->image[j],
+ exception);
break;
}
}
const char
*property;
- property=GetImageProperty(msl_info->attributes[j],"id");
+ property=GetImageProperty(msl_info->attributes[j],"id",
+ exception);
if (LocaleCompare(property,value) == 0)
{
- SetImageClipMask(msl_info->image[n],msl_info->image[j]);
+ SetImageMask(msl_info->image[n],msl_info->image[j],
+ exception);
break;
}
}
ssize_t
colorspace;
- colorspace=(ColorspaceType) ParseMagickOption(
- MagickColorspaceOptions,MagickFalse,keyword);
+ colorspace=(ColorspaceType) ParseCommandOption(
+ MagickColorspaceOptions,MagickFalse,value);
if (colorspace < 0)
ThrowMSLException(OptionError,"UnrecognizedColorspace",
value);
(void) TransformImageColorspace(msl_info->image[n],
- (ColorspaceType) colorspace);
+ (ColorspaceType) colorspace,exception);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ 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);
break;
}
case 'O':
{
if (LocaleCompare(keyword, "opacity") == 0)
{
- ssize_t opac = OpaqueOpacity,
+ ssize_t opac = OpaqueAlpha,
len = (ssize_t) strlen( value );
if (value[len-1] == '%') {
opac = (int)(QuantumRange * ((float)opac/100));
} else
opac = StringToLong( value );
- (void) SetImageOpacity( msl_info->image[n], (Quantum) opac );
+ (void) SetImageAlpha( msl_info->image[n], (Quantum) opac,
+ exception);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ msl_info->exception);
break;
}
case 'P':
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) FormatMagickString(page,MaxTextExtent,"%.20gx%.20g",
+ (void) FormatLocaleString(page,MaxTextExtent,"%.20gx%.20g",
(double) geometry.width,(double) geometry.height);
if (((flags & XValue) != 0) || ((flags & YValue) != 0))
- (void) FormatMagickString(page,MaxTextExtent,
+ (void) FormatLocaleString(page,MaxTextExtent,
"%.20gx%.20g%+.20g%+.20g",(double) geometry.width,
(double) geometry.height,(double) geometry.x,(double)
geometry.y);
break;
}
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ msl_info->exception);
break;
}
default:
{
(void) SetMSLAttributes(msl_info,keyword,value);
+ (void) SetImageProperty(msl_info->image[n],keyword,value,
+ msl_info->exception);
break;
}
}
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"azimuth") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"elevation") == 0)
{
- geometry_info.sigma=StringToDouble(value);
+ geometry_info.sigma=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
if (LocaleCompare(keyword,"gray") == 0)
{
- option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+ option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
value);
if (option < 0)
ThrowMSLException(OptionError,"UnrecognizedNoiseType",
}
}
shade_image=ShadeImage(msl_info->image[n],gray,geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (shade_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.xi=StringToDouble(value);
+ geometry_info.xi=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
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->image[n]->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 radius = 0.0,
+ double
+ radius = 0.0,
sigma = 1.0;
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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'R':
{
if (LocaleCompare(keyword, "radius") == 0)
{
- radius = StringToDouble( value );
+ radius = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
Image
*newImage;
- newImage=SharpenImage(msl_info->image[n],radius,sigma,&msl_info->image[n]->exception);
+ newImage=SharpenImage(msl_info->image[n],radius,sigma,
+ msl_info->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'G':
newImage=ShaveImage(msl_info->image[n], &rectInfo,
- &msl_info->image[n]->exception);
+ msl_info->exception);
if (newImage == (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword, "fill") == 0)
{
- (void) QueryColorDatabase(value,
- &msl_info->image[n]->background_color,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &msl_info->image[n]->background_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
if (LocaleCompare(keyword,"x") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
shear_image=ShearImage(msl_info->image[n],geometry_info.rho,
- geometry_info.sigma,&msl_info->image[n]->exception);
+ geometry_info.sigma,msl_info->exception);
if (shear_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SignatureImage(msl_info->image[n]);
+ (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
}
- (void) SolarizeImage(msl_info->image[n],geometry_info.rho);
+ (void) SolarizeImage(msl_info->image[n],geometry_info.rho,
+ msl_info->exception);
break;
}
if (LocaleCompare((const char *) tag,"spread") == 0)
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"radius") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'I':
for (j=0; j<msl_info->n;j++)
{
const char *
- theAttr = GetImageProperty(msl_info->attributes[j], "id");
+ theAttr = GetImageProperty(msl_info->attributes[j], "id",
+ exception);
if (theAttr && LocaleCompare(theAttr, value) == 0)
{
watermark = msl_info->image[j];
Image
*newImage;
- newImage=SteganoImage(msl_info->image[n], watermark, &msl_info->image[n]->exception);
+ newImage=SteganoImage(msl_info->image[n], watermark, msl_info->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'I':
for (j=0; j<msl_info->n;j++)
{
const char *
- theAttr = GetImageProperty(msl_info->attributes[j], "id");
+ theAttr = GetImageProperty(msl_info->attributes[j], "id",
+ exception);
if (theAttr && LocaleCompare(theAttr, value) == 0)
{
stereoImage = msl_info->image[j];
Image
*newImage;
- newImage=StereoImage(msl_info->image[n], stereoImage, &msl_info->image[n]->exception);
+ newImage=StereoImage(msl_info->image[n], stereoImage, msl_info->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
} 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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
ThrowMSLException(OptionError,"NoSuchImage",(const char *) tag);
break;
}
- swap=CloneImage(p,0,0,MagickTrue,&p->exception);
- ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,&q->exception));
+ swap=CloneImage(p,0,0,MagickTrue,msl_info->exception);
+ ReplaceImageInList(&p,CloneImage(q,0,0,MagickTrue,
+ msl_info->exception));
ReplaceImageInList(&q,swap);
msl_info->image[n]=GetFirstImageInList(q);
break;
{
keyword=(const char *) attributes[i++];
attribute=InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
{
if (LocaleCompare(keyword,"degrees") == 0)
{
- geometry_info.rho=StringToDouble(value);
+ geometry_info.rho=StringToDouble(value,
+ (char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
}
}
swirl_image=SwirlImage(msl_info->image[n],geometry_info.rho,
- &msl_info->image[n]->exception);
+ msl_info->image[n]->interpolate,msl_info->exception);
if (swirl_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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
}
}
}
- (void) SyncImage(msl_info->image[n]);
+ (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]);
+ msl_info->attributes[n],(const char *) attributes[i],
+ exception);
CloneString(&value,attribute);
switch (*keyword)
{
const char
*attribute;
- attribute=GetImageProperty(msl_info->attributes[j],"id");
+ attribute=GetImageProperty(msl_info->attributes[j],"id",
+ 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);
+ (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]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'T':
{
if (LocaleCompare(keyword,"threshold") == 0)
{
- threshold = StringToDouble( value );
+ threshold = StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
process image.
*/
{
- BilevelImageChannel(msl_info->image[n],
- (ChannelType) ((ssize_t) (AllChannels &~ (ssize_t) OpacityChannel)),
- threshold);
- break;
+ BilevelImage(msl_info->image[n],threshold,exception);
+ break;
}
}
else if (LocaleCompare((const char *) tag, "transparent") == 0)
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'C':
{
if (LocaleCompare(keyword,"color") == 0)
{
- MagickPixelPacket
+ PixelInfo
target;
- (void) QueryMagickColor(value,&target,&exception);
+ (void) QueryColorCompliance(value,AllCompliance,&target,
+ exception);
(void) TransparentPaintImage(msl_info->image[n],&target,
- TransparentOpacity,MagickFalse);
+ TransparentAlpha,MagickFalse,msl_info->exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
rectInfo.height = rectInfo.width = 0;
rectInfo.x = rectInfo.y = 0;
- newImage=CropImage(msl_info->image[n],&rectInfo, &msl_info->image[n]->exception);
+ newImage=CropImage(msl_info->image[n],&rectInfo, msl_info->exception);
if (newImage == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
{
keyword=(const char *) attributes[i++];
CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
- msl_info->attributes[n],(const char *) attributes[i]));
+ msl_info->attributes[n],(const char *) attributes[i],exception));
switch (*keyword)
{
case 'F':
/* process */
{
- (void) WriteImage(msl_info->image_info[n], msl_info->image[n]);
+ (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()," )");
}
break;
StripString(msl_info->content);
(void) SetImageProperty(msl_info->image[n],"comment",
- msl_info->content);
+ msl_info->content,msl_info->exception);
break;
}
break;
while ( i-- )
{
if (msl_info->image[msl_info->n] != (Image *) NULL)
- msl_info->image[msl_info->n]=DestroyImage(msl_info->image[msl_info->n]);
- msl_info->attributes[msl_info->n]=DestroyImage(msl_info->attributes[msl_info->n]);
- msl_info->image_info[msl_info->n]=DestroyImageInfo(msl_info->image_info[msl_info->n]);
+ msl_info->image[msl_info->n]=DestroyImage(
+ msl_info->image[msl_info->n]);
+ msl_info->attributes[msl_info->n]=DestroyImage(
+ msl_info->attributes[msl_info->n]);
+ msl_info->image_info[msl_info->n]=DestroyImageInfo(
+ msl_info->image_info[msl_info->n]);
msl_info->n--;
}
}
break;
StripString(msl_info->content);
(void) SetImageProperty(msl_info->image[n],"label",
- msl_info->content);
+ msl_info->content,msl_info->exception);
break;
}
break;
else
{
msl_info->content=(char *) NULL;
- if (~length >= MaxTextExtent)
+ if (~length >= (MaxTextExtent-1))
msl_info->content=(char *) AcquireQuantumMemory(length+MaxTextExtent,
sizeof(*msl_info->content));
if (msl_info->content != (char *) NULL)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.ignorableWhitespace(%.30s, %d)",c,length);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLProcessingInstructions(void *context,const xmlChar *target,
" SAX.processingInstruction(%s, %s)",
target,data);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLComment(void *context,const xmlChar *value)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.comment(%s)",value);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
}
static void MSLWarning(void *context,const char *format,...)
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.warning: ");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),format,operands);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsprintf(reason,format,operands);
#else
(void) LogMagickEvent(CoderEvent,GetMagickModule()," SAX.error: ");
(void) LogMagickEvent(CoderEvent,GetMagickModule(),format,operands);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
#if !defined(MAGICKCORE_HAVE_VSNPRINTF)
(void) vsprintf(reason,format,operands);
#else
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" SAX.pcdata(%s, %d)",value,length);
msl_info=(MSLInfo *) context;
+ (void) msl_info;
parser=msl_info->parser;
child=xmlGetLastChild(parser->node);
if ((child != (xmlNodePtr) NULL) && (child->type == XML_CDATA_SECTION_NODE))
(external_id != (const xmlChar *) NULL ? (const char *) external_id : " "),
(system_id != (const xmlChar *) NULL ? (const char *) system_id : " "));
msl_info=(MSLInfo *) context;
+ (void) msl_info;
parser=msl_info->parser;
if (((external_id == NULL) && (system_id == NULL)) ||
((parser->validate == 0) || (parser->wellFormed == 0) ||
}
#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];
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
assert(image != (Image **) NULL);
- msl_image=AcquireImage(image_info);
+ msl_image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,msl_image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
msl_info.draw_info=(DrawInfo **) AcquireMagickMemory(
sizeof(*msl_info.draw_info));
/* top of the stack is the MSL file itself */
- msl_info.image=(Image **) AcquireAlignedMemory(1,sizeof(*msl_info.image));
+ msl_info.image=(Image **) AcquireMagickMemory(sizeof(*msl_info.image));
msl_info.attributes=(Image **) AcquireMagickMemory(
sizeof(*msl_info.attributes));
msl_info.group_info=(MSLGroupInfo *) AcquireMagickMemory(
"UnableToInterpretMSLImage");
*msl_info.image_info=CloneImageInfo(image_info);
*msl_info.draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
- *msl_info.attributes=AcquireImage(image_info);
+ *msl_info.attributes=AcquireImage(image_info,exception);
msl_info.group_info[0].numImages=0;
/* the first slot is used to point to the MSL file image */
*msl_info.image=msl_image;
(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)
*image=(*msl_info.image);
- if ((*msl_info.image)->exception.severity != UndefinedException)
+ if (msl_info.exception->severity != UndefinedException)
return(MagickFalse);
return(MagickTrue);
}
MagickInfo
*entry;
+#if defined(MAGICKCORE_XML_DELEGATE)
+ xmlInitParser();
+#endif
entry=SetMagickInfo("MSL");
#if defined(MAGICKCORE_XML_DELEGATE)
entry->decoder=(DecodeImageHandler *) ReadMSLImage;
ssize_t
adjoin;
- adjoin=ParseMagickOption(MagickBooleanOptions,MagickFalse,value);
+ adjoin=ParseCommandOption(MagickBooleanOptions,MagickFalse,value);
if (adjoin < 0)
ThrowMSLException(OptionError,"UnrecognizedType",value);
image_info->adjoin=(MagickBooleanType) adjoin;
ssize_t
alpha;
- alpha=ParseMagickOption(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,"antialias") == 0)
ssize_t
antialias;
- antialias=ParseMagickOption(MagickBooleanOptions,MagickFalse,value);
+ antialias=ParseCommandOption(MagickBooleanOptions,MagickFalse,value);
if (antialias < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",value);
image_info->antialias=(MagickBooleanType) antialias;
limit=MagickResourceInfinity;
if (LocaleCompare(value,"unlimited") != 0)
- limit=(MagickSizeType) SiPrefixToDouble(value,100.0);
+ limit=(MagickSizeType) StringToDoubleInterval(value,100.0);
(void) SetMagickResourceLimit(AreaResource,limit);
break;
}
{
if (LocaleCompare(keyword,"background") == 0)
{
- (void) QueryColorDatabase(value,&image_info->background_color,
- exception);
- break;
- }
- if (LocaleCompare(keyword,"bias") == 0)
- {
- if (image == (Image *) NULL)
- break;
- image->bias=SiPrefixToDouble(value,QuantumRange);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->background_color,exception);
break;
}
if (LocaleCompare(keyword,"blue-primary") == 0)
}
if (LocaleCompare(keyword,"bordercolor") == 0)
{
- (void) QueryColorDatabase(value,&image_info->border_color,
- exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->border_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"fill") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->fill,exception);
+ (void) QueryColorCompliance(value,AllCompliance,&draw_info->fill,
+ exception);
(void) SetImageOption(image_info,keyword,value);
break;
}
ssize_t
gravity;
- gravity=ParseMagickOption(MagickGravityOptions,MagickFalse,value);
+ gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,value);
if (gravity < 0)
ThrowMSLException(OptionError,"UnrecognizedGravityType",value);
(void) SetImageOption(image_info,keyword,value);
{
if (LocaleCompare(keyword,"id") == 0)
{
- (void) SetImageProperty(attributes,keyword,value);
+ (void) SetImageProperty(attributes,keyword,value,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
if (LocaleCompare(keyword,"mattecolor") == 0)
{
- (void) QueryColorDatabase(value,&image_info->matte_color,
- exception);
+ (void) QueryColorCompliance(value,AllCompliance,
+ &image_info->matte_color,exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
{
if (LocaleCompare(keyword,"pointsize") == 0)
{
- image_info->pointsize=StringToDouble(value);
- draw_info->pointsize=StringToDouble(value);
+ image_info->pointsize=StringToDouble(value,(char **) NULL);
+ draw_info->pointsize=StringToDouble(value,(char **) NULL);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
}
if (LocaleCompare(keyword,"stroke") == 0)
{
- (void) QueryColorDatabase(value,&draw_info->stroke,exception);
+ (void) QueryColorCompliance(value,AllCompliance,&draw_info->stroke,
+ exception);
(void) SetImageOption(image_info,keyword,value);
break;
}
ModuleExport void UnregisterMSLImage(void)
{
(void) UnregisterMagickInfo("MSL");
+#if defined(MAGICKCORE_XML_DELEGATE)
+ xmlCleanupParser();
+#endif
}
\f
#if defined(MAGICKCORE_XML_DELEGATE)
%
% The format of the WriteMSLImage method is:
%
-% MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image)
+% MagickBooleanType WriteMSLImage(const ImageInfo *image_info,
+% Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o image: The image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image)
+static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image,
+ ExceptionInfo *exception)
{
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
(void) ReferenceImage(image);
- (void) ProcessMSLScript(image_info,&image,&image->exception);
+ (void) ProcessMSLScript(image_info,&image,exception);
return(MagickTrue);
}
#endif