]> granicus.if.org Git - imagemagick/blobdiff - coders/msl.c
(no commit message)
[imagemagick] / coders / msl.c
index 539fa9783fc36bbbdfe96a174b7f19ed92d6d18a..71b95580b91935ab9a3bcc9eccaea2755f52cc6a 100644 (file)
@@ -19,7 +19,7 @@
 %                               December 2001                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 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/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/option.h"
-#include "magick/paint.h"
-#include "magick/property.h"
-#include "magick/quantize.h"
-#include "magick/quantum-private.h"
-#include "magick/resize.h"
-#include "magick/segment.h"
-#include "magick/shear.h"
-#include "magick/signature.h"
-#include "magick/static.h"
-#include "magick/string_.h"
-#include "magick/module.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/blob.h"
+#include "MagickCore/blob-private.h"
+#include "MagickCore/cache.h"
+#include "MagickCore/cache-view.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/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/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(__WINDOWS__)
+#  if defined(MAGICKCORE_WINDOWS_SUPPORT)
 #    if defined(__MINGW32__)
 #      define _MSC_VER
 #    else
 */
 typedef struct _MSLGroupInfo
 {
-  unsigned long
+  size_t
     numImages;  /* how many images are in this group */
 } MSLGroupInfo;
 
@@ -117,7 +123,7 @@ typedef struct _MSLInfo
   ExceptionInfo
     *exception;
 
-  long
+  ssize_t
     n,
     number_groups;
 
@@ -151,7 +157,7 @@ typedef struct _MSLInfo
 */
 #if defined(MAGICKCORE_XML_DELEGATE)
 static MagickBooleanType
-  WriteMSLImage(const ImageInfo *,Image *);
+  WriteMSLImage(const ImageInfo *,Image *,ExceptionInfo *);
 
 static MagickBooleanType
   SetMSLAttributes(MSLInfo *,const char *,const char *);
@@ -190,6 +196,54 @@ static MagickBooleanType
 extern "C" {
 #endif
 
+static inline Image *GetImageCache(const ImageInfo *image_info,const char *path,
+  ExceptionInfo *exception)
+{
+  char
+    key[MaxTextExtent];
+
+  ExceptionInfo
+    *sans_exception;
+
+  Image
+    *image;
+
+  ImageInfo
+    *read_info;
+
+  (void) FormatLocaleString(key,MaxTextExtent,"cache:%s",path);
+  sans_exception=AcquireExceptionInfo();
+  image=(Image *) GetImageRegistry(ImageRegistryType,key,sans_exception);
+  sans_exception=DestroyExceptionInfo(sans_exception);
+  if (image != (Image *) NULL)
+    return(image);
+  read_info=CloneImageInfo(image_info);
+  (void) CopyMagickString(read_info->filename,path,MaxTextExtent);
+  image=ReadImage(read_info,exception);
+  read_info=DestroyImageInfo(read_info);
+  if (image != (Image *) NULL)
+    (void) SetImageRegistry(ImageRegistryType,key,image,exception);
+  return(image);
+}
+
+static int IsPathDirectory(const char *path)
+{
+  MagickBooleanType
+    status;
+
+  struct stat
+    attributes;
+
+  if ((path == (const char *) NULL) || (*path == '\0'))
+    return(MagickFalse);
+  status=GetPathAttributes(path,&attributes);
+  if (status == MagickFalse)
+    return(-1);
+  if (S_ISDIR(attributes.st_mode) == 0)
+    return(0);
+  return(1);
+}
+
 static int MSLIsStandalone(void *context)
 {
   MSLInfo
@@ -449,6 +503,7 @@ static void MSLSetDocumentLocator(void *context,xmlSAXLocatorPtr location)
     "  SAX.setDocumentLocator()\n");
   (void) location;
   msl_info=(MSLInfo *) context;
+  (void) msl_info;
 }
 
 static void MSLStartDocument(void *context)
@@ -492,7 +547,7 @@ static void MSLEndDocument(void *context)
 
 static void MSLPushImage(MSLInfo *msl_info,Image *image)
 {
-  long
+  ssize_t
     n;
 
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
@@ -516,7 +571,8 @@ static void MSLPushImage(MSLInfo *msl_info,Image *image)
   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],
+      &image->exception);
   else
     msl_info->attributes[n]=CloneImage(image,0,0,MagickTrue,&image->exception);
   msl_info->image[n]=(Image *) image;
@@ -550,6 +606,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
   ChannelType
     channel;
 
+  ChannelType
+    channel_mask;
+
   char
     key[MaxTextExtent],
     *value;
@@ -576,7 +635,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
   int
     flags;
 
-  long
+  ssize_t
     option,
     j,
     n,
@@ -589,10 +648,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
   RectangleInfo
     geometry;
 
-  register long
+  register ssize_t
     i;
 
-  unsigned long
+  size_t
     height,
     width;
 
@@ -636,7 +695,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -661,7 +721,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"noise") == 0)
                     {
-                      option=ParseMagickOption(MagickNoiseOptions,MagickFalse,
+                      option=ParseCommandOption(MagickNoiseOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedNoiseType",
@@ -681,8 +741,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          noise_image=AddNoiseImageChannel(msl_info->image[n],channel,noise,
+          channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+          noise_image=AddNoiseImage(msl_info->image[n],noise,
             &msl_info->image[n]->exception);
+          (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
           if (noise_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -713,7 +775,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -726,27 +789,27 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                         *p;
 
                       p=value;
-                      draw_info->affine.sx=strtod(p,&p);
+                      draw_info->affine.sx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.rx=strtod(p,&p);
+                      draw_info->affine.rx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.ry=strtod(p,&p);
+                      draw_info->affine.ry=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.sy=strtod(p,&p);
+                      draw_info->affine.sy=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.tx=strtod(p,&p);
+                      draw_info->affine.tx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.ty=strtod(p,&p);
+                      draw_info->affine.ty=InterpretLocaleValue(p,&p);
                       break;
                     }
                   if (LocaleCompare(keyword,"align") == 0)
                     {
-                      option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+                      option=ParseCommandOption(MagickAlignOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedAlignType",
@@ -756,7 +819,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"antialias") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -798,8 +861,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   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)
@@ -821,16 +884,14 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"geometry") == 0)
                     {
-                      flags=ParsePageGeometry(msl_info->image[n],value,
+                      flags=ParseGravityGeometry(msl_info->image[n],value,
                         &geometry,&exception);
-                      if ((flags & HeightValue) == 0)
-                        geometry.height=geometry.width;
                       break;
                     }
                   if (LocaleCompare(keyword,"gravity") == 0)
                     {
-                      option=ParseMagickOption(MagickGravityOptions,MagickFalse,
-                        value);
+                      option=ParseCommandOption(MagickGravityOptions,
+                        MagickFalse,value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedGravityType",
                           value);
@@ -846,7 +907,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"pointsize") == 0)
                     {
-                      draw_info->pointsize=atof(value);
+                      draw_info->pointsize=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -858,7 +920,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"rotate") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(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))));
@@ -883,22 +945,22 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"skewX") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(value,(char **) NULL);
                       affine.ry=tan(DegreesToRadians(fmod((double) angle,
                         360.0)));
                       break;
                     }
                   if (LocaleCompare(keyword,"skewY") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(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);
@@ -907,18 +969,18 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   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)
                     {
-                      draw_info->stroke_width=atol(value);
+                      draw_info->stroke_width=StringToLong(value);
                       break;
                     }
                   if (LocaleCompare(keyword,"style") == 0)
                     {
-                      option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+                      option=ParseCommandOption(MagickStyleOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedStyleType",
@@ -956,8 +1018,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword, "undercolor") == 0)
                     {
-                      (void) QueryColorDatabase(value,&draw_info->undercolor,
-                        &exception);
+                      (void) QueryColorCompliance(value,AllCompliance,
+                        &draw_info->undercolor,&exception);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -969,7 +1031,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"weight") == 0)
                     {
-                      draw_info->weight=atol(value);
+                      draw_info->weight=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -981,7 +1043,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -993,7 +1055,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1008,18 +1070,20 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
-            geometry.width,geometry.height,geometry.x,geometry.y);
+          (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->image[n]->exception);
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
@@ -1043,7 +1107,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1052,7 +1117,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"stack") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -1105,7 +1170,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1144,7 +1210,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1156,7 +1223,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"sigma") == 0)
                     {
-                      geometry_info.sigma=atol(value);
+                      geometry_info.sigma=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1171,9 +1238,11 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          blur_image=BlurImageChannel(msl_info->image[n],channel,
-            geometry_info.rho,geometry_info.sigma,
+          channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+          blur_image=BlurImage(msl_info->image[n],geometry_info.rho,
+            geometry_info.sigma,geometry_info.xi,
             &msl_info->image[n]->exception);
+          (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
           if (blur_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -1200,7 +1269,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1209,7 +1279,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"compose") == 0)
                     {
-                      option=ParseMagickOption(MagickComposeOptions,MagickFalse,
+                      option=ParseCommandOption(MagickComposeOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedComposeType",
@@ -1226,7 +1296,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword, "fill") == 0)
                     {
-                      (void) QueryColorDatabase(value,
+                      (void) QueryColorCompliance(value,AllCompliance,
                         &msl_info->image[n]->border_color,&exception);
                       break;
                     }
@@ -1254,7 +1324,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=atol(value);
+                      geometry.height=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1266,7 +1336,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1282,7 +1352,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           border_image=BorderImage(msl_info->image[n],&geometry,
-            &msl_info->image[n]->exception);
+            msl_info->image[n]->compose,&msl_info->image[n]->exception);
           if (border_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -1321,7 +1391,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1330,7 +1401,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"fill") == 0)
                     {
-                      (void) QueryColorDatabase(value,&target,
+                      (void) QueryColorCompliance(value,AllCompliance,&target,
                         &msl_info->image[n]->exception);
                       break;
                     }
@@ -1368,7 +1439,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
       if (LocaleCompare((const char *) tag, "charcoal") == 0)
       {
-        double  radius = 0.0,
+        double bias = 0.0,
+            radius = 0.0,
             sigma = 1.0;
 
         if (msl_info->image[n] == (Image *) NULL)
@@ -1386,15 +1458,26 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           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':
+            case 'b':
+            {
+              if (LocaleCompare(keyword, "bias") == 0)
+              {
+                bias = InterpretLocaleValue(value,(char **) NULL);
+                break;
+              }
+              ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+              break;
+            }
             case 'R':
             case 'r':
             {
               if (LocaleCompare(keyword, "radius") == 0)
               {
-                radius = atof( value );
+                radius = InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -1405,7 +1488,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword,"sigma") == 0)
               {
-                sigma = atol( value );
+                sigma = StringToLong( value );
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -1427,7 +1510,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         Image
           *newImage;
 
-        newImage=CharcoalImage(msl_info->image[n],radius,sigma,
+        newImage=CharcoalImage(msl_info->image[n],radius,sigma,bias,
           &msl_info->image[n]->exception);
         if (newImage == (Image *) NULL)
           break;
@@ -1456,7 +1539,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1480,7 +1564,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=atol(value);
+                      geometry.height=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1492,7 +1576,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1504,7 +1588,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1516,7 +1600,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1544,7 +1628,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           PaintMethod
             paint_method;
 
-          MagickPixelPacket
+          PixelInfo
             target;
 
           /*
@@ -1565,7 +1649,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1574,7 +1659,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"bordercolor") == 0)
                     {
-                      (void) QueryMagickColor(value,&target,&exception);
+                      (void) QueryMagickColorCompliance(value,AllCompliance,
+                        &target,&exception);
                       paint_method=FillToBorderMethod;
                       break;
                     }
@@ -1587,13 +1673,14 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   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=atof(value);
+                      msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1622,7 +1709,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       (void) GetOneVirtualMagickPixel(msl_info->image[n],
                         geometry.x,geometry.y,&target,&exception);
                       break;
@@ -1636,7 +1723,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       (void) GetOneVirtualMagickPixel(msl_info->image[n],
                         geometry.x,geometry.y,&target,&exception);
                       break;
@@ -1653,9 +1740,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (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->image[n]->exception);
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
@@ -1692,7 +1779,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1701,7 +1789,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"compose") == 0)
                     {
-                      option=ParseMagickOption(MagickComposeOptions,MagickFalse,
+                      option=ParseCommandOption(MagickComposeOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedComposeType",
@@ -1744,7 +1832,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -1775,7 +1864,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword, "color") == 0)
                     {
-                      (void) QueryColorDatabase(value,
+                      (void) QueryColorCompliance(value,AllCompliance,
                         &composite_image->background_color,&exception);
                       break;
                     }
@@ -1800,7 +1889,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"gravity") == 0)
                     {
-                      option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+                      option=ParseCommandOption(MagickGravityOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedGravityType",
@@ -1834,7 +1923,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       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);
                           break;
@@ -1849,20 +1939,20 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"opacity") == 0)
                     {
-                      long
+                      ssize_t
                         opacity,
                         y;
 
-                      register long
+                      register ssize_t
                         x;
 
-                      register PixelPacket
+                      register Quantum
                         *q;
 
                       CacheView
                         *composite_view;
 
-                      opacity=QuantumRange-atol(value);
+                      opacity=StringToLong(value);
                       if (compose != DissolveCompositeOp)
                         {
                           (void) SetImageOpacity(composite_image,(Quantum)
@@ -1872,17 +1962,18 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       (void) SetImageArtifact(msl_info->image[n],
                                             "compose:args",value);
                       if (composite_image->matte != MagickTrue)
-                        (void) SetImageOpacity(composite_image,OpaqueOpacity);
+                        (void) SetImageOpacity(composite_image,OpaqueAlpha);
                       composite_view=AcquireCacheView(composite_image);
-                      for (y=0; y < (long) composite_image->rows ; y++)
+                      for (y=0; y < (ssize_t) composite_image->rows ; y++)
                       {
-                        q=GetCacheViewAuthenticPixels(composite_view,0,y,(long)
-                          composite_image->columns,1,&exception);
-                        for (x=0; x < (long) composite_image->columns; x++)
+                        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=RoundToQuantum(opacity);
-                          q++;
+                          if (GetPixelAlpha(composite_image,q) == OpaqueAlpha)
+                            SetPixelAlpha(composite_image,
+                              ClampToQuantum(opacity),q);
+                          q+=GetPixelChannels(composite_image);
                         }
                         if (SyncCacheViewAuthenticPixels(composite_view,&exception) == MagickFalse)
                           break;
@@ -1899,8 +1990,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"rotate") == 0)
                     {
-                      rotate_image=RotateImage(composite_image,atof(value),
-                        &exception);
+                      rotate_image=RotateImage(composite_image,
+                        InterpretLocaleValue(value,(char **) NULL),&exception);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -1915,12 +2006,13 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       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");
@@ -1930,8 +2022,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                        image=msl_info->image[n];
                        height=composite_image->rows;
                        width=composite_image->columns;
-                       for (y=0; y < (long) image->rows; y+=height)
-                         for (x=0; x < (long) image->columns; x+=width)
+                       for (y=0; y < (ssize_t) image->rows; y+=(ssize_t) height)
+                         for (x=0; x < (ssize_t) image->columns; x+=(ssize_t) width)
                          {
                            if (rotate_image != (Image *) NULL)
                              (void) CompositeImage(image,compose,rotate_image,
@@ -1953,7 +2045,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       (void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
                         geometry.y,&target,&exception);
                       break;
@@ -1967,7 +2059,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       (void) GetOneVirtualPixel(msl_info->image[n],geometry.x,
                         geometry.y,&target,&exception);
                       break;
@@ -1985,26 +2077,27 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           image=msl_info->image[n];
-          (void) FormatMagickString(composite_geometry,MaxTextExtent,
-            "%lux%lu%+ld%+ld",composite_image->columns,composite_image->rows,
-            geometry.x,geometry.y);
+          (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);
+          channel_mask=SetPixelChannelMask(image,channel);
           if (rotate_image == (Image *) NULL)
-            CompositeImageChannel(image,channel,compose,composite_image,
-              geometry.x,geometry.y);
+            CompositeImage(image,compose,composite_image,geometry.x,geometry.y);
           else
             {
               /*
                 Rotate image.
               */
-              geometry.x-=(long) (rotate_image->columns-
+              geometry.x-=(ssize_t) (rotate_image->columns-
                 composite_image->columns)/2;
-              geometry.y-=(long) (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,compose,rotate_image,geometry.x,geometry.y);
               rotate_image=DestroyImage(rotate_image);
             }
+          (void) SetPixelChannelMask(image,channel_mask);
           composite_image=DestroyImage(composite_image);
           break;
         }
@@ -2028,7 +2121,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2037,7 +2131,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"sharpen") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -2057,7 +2151,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) ContrastImage(msl_info->image[n],sharpen);
+          (void) ContrastImage(msl_info->image[n],sharpen,
+            &msl_info->image[n]->exception);
           break;
         }
       if (LocaleCompare((const char *) tag,"crop") == 0)
@@ -2080,7 +2175,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2089,10 +2185,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"geometry") == 0)
                     {
-                      flags=ParsePageGeometry(msl_info->image[n],value,
+                      flags=ParseGravityGeometry(msl_info->image[n],value,
                         &geometry,&exception);
-                      if ((flags & HeightValue) == 0)
-                        geometry.height=geometry.width;
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2104,7 +2198,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=atol(value);
+                      geometry.height=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2116,7 +2210,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2128,7 +2222,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2140,7 +2234,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2165,7 +2259,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
       if (LocaleCompare((const char *) tag,"cycle-colormap") == 0)
         {
-          long
+          ssize_t
             display;
 
           /*
@@ -2183,7 +2277,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2192,7 +2287,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"display") == 0)
                     {
-                      display=atol(value);
+                      display=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2207,7 +2302,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) CycleColormapImage(msl_info->image[n],display);
+          (void) CycleColormapImage(msl_info->image[n],display,&exception);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
@@ -2234,7 +2329,8 @@ static void MSLStartElement(void *context,const xmlChar *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);
             }
@@ -2259,7 +2355,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2271,7 +2368,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) DisplayImages(msl_info->image_info[n],msl_info->image[n]);
+          (void) DisplayImages(msl_info->image_info[n],msl_info->image[n],
+            &msl_info->image[n]->exception);
           break;
         }
       if (LocaleCompare((const char *) tag,"draw") == 0)
@@ -2298,7 +2396,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2311,27 +2410,27 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                         *p;
 
                       p=value;
-                      draw_info->affine.sx=strtod(p,&p);
+                      draw_info->affine.sx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.rx=strtod(p,&p);
+                      draw_info->affine.rx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.ry=strtod(p,&p);
+                      draw_info->affine.ry=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.sy=strtod(p,&p);
+                      draw_info->affine.sy=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.tx=strtod(p,&p);
+                      draw_info->affine.tx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.ty=strtod(p,&p);
+                      draw_info->affine.ty=InterpretLocaleValue(p,&p);
                       break;
                     }
                   if (LocaleCompare(keyword,"align") == 0)
                     {
-                      option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+                      option=ParseCommandOption(MagickAlignOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedAlignType",
@@ -2341,7 +2440,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"antialias") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -2383,8 +2482,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   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)
@@ -2414,7 +2513,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"gravity") == 0)
                     {
-                      option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+                      option=ParseCommandOption(MagickGravityOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedGravityType",
@@ -2436,7 +2535,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"pointsize") == 0)
                     {
-                      draw_info->pointsize=atof(value);
+                      draw_info->pointsize=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2448,7 +2548,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"rotate") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(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))));
@@ -2473,20 +2573,20 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"skewX") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(value,(char **) NULL);
                       affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
                       break;
                     }
                   if (LocaleCompare(keyword,"skewY") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(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);
@@ -2495,18 +2595,18 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   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)
                     {
-                      draw_info->stroke_width=atol(value);
+                      draw_info->stroke_width=StringToLong(value);
                       break;
                     }
                   if (LocaleCompare(keyword,"style") == 0)
                     {
-                      option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+                      option=ParseCommandOption(MagickStyleOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedStyleType",
@@ -2544,8 +2644,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword, "undercolor") == 0)
                     {
-                      (void) QueryColorDatabase(value,&draw_info->undercolor,
-                        &exception);
+                      (void) QueryColorCompliance(value,AllCompliance,
+                        &draw_info->undercolor,&exception);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2557,7 +2657,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"weight") == 0)
                     {
-                      draw_info->weight=atol(value);
+                      draw_info->weight=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2569,7 +2669,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2581,7 +2681,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2596,18 +2696,19 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
-            geometry.width,geometry.height,geometry.x,geometry.y);
+          (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;
         }
@@ -2635,7 +2736,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2658,7 +2760,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2674,7 +2777,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           edge_image=EdgeImage(msl_info->image[n],geometry_info.rho,
-            &msl_info->image[n]->exception);
+            geometry_info.sigma,&msl_info->image[n]->exception);
           if (edge_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -2700,7 +2803,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2723,7 +2827,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2735,7 +2840,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"sigma") == 0)
                     {
-                      geometry_info.sigma=atol(value);
+                      geometry_info.sigma=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -2777,7 +2882,8 @@ static void MSLStartElement(void *context,const xmlChar *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);
             }
@@ -2805,7 +2911,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2817,7 +2924,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) EqualizeImage(msl_info->image[n]);
+          (void) EqualizeImage(msl_info->image[n],
+            &msl_info->image[n]->exception);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
@@ -2869,7 +2977,8 @@ static void MSLStartElement(void *context,const xmlChar *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);
             }
@@ -2900,7 +3009,8 @@ static void MSLStartElement(void *context,const xmlChar *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);
             }
@@ -2935,7 +3045,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -2944,7 +3055,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"compose") == 0)
                     {
-                      option=ParseMagickOption(MagickComposeOptions,
+                      option=ParseCommandOption(MagickComposeOptions,
                         MagickFalse,value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedComposeType",
@@ -2961,7 +3072,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword, "fill") == 0)
                     {
-                      (void) QueryColorDatabase(value,
+                      (void) QueryColorCompliance(value,AllCompliance,
                         &msl_info->image[n]->matte_color,&exception);
                       break;
                     }
@@ -2993,7 +3104,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      frame_info.height=atol(value);
+                      frame_info.height=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3005,7 +3116,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"inner") == 0)
                     {
-                      frame_info.inner_bevel=atol(value);
+                      frame_info.inner_bevel=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3017,7 +3128,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"outer") == 0)
                     {
-                      frame_info.outer_bevel=atol(value);
+                      frame_info.outer_bevel=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3029,7 +3140,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      frame_info.width=atol(value);
+                      frame_info.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3044,12 +3155,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          frame_info.x=(long) frame_info.width;
-          frame_info.y=(long) frame_info.height;
+          frame_info.x=(ssize_t) frame_info.width;
+          frame_info.y=(ssize_t) frame_info.height;
           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->image[n]->exception);
           if (frame_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -3066,7 +3177,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           char
             gamma[MaxTextExtent];
 
-          MagickPixelPacket
+          PixelInfo
             pixel;
 
           /*
@@ -3088,7 +3199,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3097,7 +3209,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"blue") == 0)
                     {
-                      pixel.blue=atof(value);
+                      pixel.blue=InterpretLocaleValue(value,(char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3130,7 +3242,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"green") == 0)
                     {
-                      pixel.green=atof(value);
+                      pixel.green=InterpretLocaleValue(value,(char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3142,7 +3254,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"red") == 0)
                     {
-                      pixel.red=atof(value);
+                      pixel.red=InterpretLocaleValue(value,(char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3158,33 +3270,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           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->image[n]->exception);
           break;
         }
       else if (LocaleCompare((const char *) tag,"get") == 0)
@@ -3209,8 +3298,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               {
                 if (LocaleCompare(keyword,"height") == 0)
                   {
-                    (void) FormatMagickString(value,MaxTextExtent,"%ld",
-                      msl_info->image[n]->rows);
+                    (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
+                      (double) msl_info->image[n]->rows);
                     (void) SetImageProperty(msl_info->attributes[n],key,value);
                     break;
                   }
@@ -3221,8 +3310,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               {
                 if (LocaleCompare(keyword,"width") == 0)
                   {
-                    (void) FormatMagickString(value,MaxTextExtent,"%ld",
-                      msl_info->image[n]->columns);
+                    (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
+                      (double) msl_info->image[n]->columns);
                     (void) SetImageProperty(msl_info->attributes[n],key,value);
                     break;
                   }
@@ -3259,7 +3348,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             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':
@@ -3327,7 +3416,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3336,7 +3426,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"amount") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3366,7 +3457,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           implode_image=ImplodeImage(msl_info->image[n],geometry_info.rho,
-            &msl_info->image[n]->exception);
+            msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
           if (implode_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -3405,7 +3496,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword,"black") == 0)
               {
-                levelBlack = atof( value );
+                levelBlack = InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -3416,7 +3507,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword,"gamma") == 0)
               {
-                levelGamma = atof( value );
+                levelGamma = InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -3427,7 +3518,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword,"white") == 0)
               {
-                levelWhite = atof( value );
+                levelWhite = InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -3442,13 +3533,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
 
         /* 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->image[n]->exception);
+        break;
       }
     }
     case 'M':
@@ -3473,7 +3560,8 @@ static void MSLStartElement(void *context,const xmlChar *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);
             }
@@ -3512,7 +3600,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3521,7 +3610,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"dither") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -3564,7 +3653,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           quantize_info=AcquireQuantizeInfo(msl_info->image_info[n]);
           quantize_info->dither=dither;
           (void) RemapImages(quantize_info,msl_info->image[n],
-            affinity_image);
+            affinity_image,&exception);
           quantize_info=DestroyQuantizeInfo(quantize_info);
           affinity_image=DestroyImage(affinity_image);
           break;
@@ -3574,7 +3663,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           double
             opacity;
 
-          MagickPixelPacket
+          PixelInfo
             target;
 
           PaintMethod
@@ -3597,7 +3686,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3606,7 +3696,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"bordercolor") == 0)
                     {
-                      (void) QueryMagickColor(value,&target,&exception);
+                      (void) QueryMagickColorCompliance(value,AllCompliance,
+                        &target,&exception);
                       paint_method=FillToBorderMethod;
                       break;
                     }
@@ -3619,7 +3710,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"fuzz") == 0)
                     {
-                      msl_info->image[n]->fuzz=atof(value);
+                      msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3648,7 +3740,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"opacity") == 0)
                     {
-                      opacity=atof(value);
+                      opacity=InterpretLocaleValue(value,(char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3660,7 +3752,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       (void) GetOneVirtualMagickPixel(msl_info->image[n],
                         geometry.x,geometry.y,&target,&exception);
                       break;
@@ -3674,7 +3766,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       (void) GetOneVirtualMagickPixel(msl_info->image[n],
                         geometry.x,geometry.y,&target,&exception);
                       break;
@@ -3693,10 +3785,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             }
           draw_info=CloneDrawInfo(msl_info->image_info[n],
             msl_info->draw_info[n]);
-          draw_info->fill.opacity=RoundToQuantum(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=SetPixelChannelMask(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->image[n]->exception);
+          (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
@@ -3719,7 +3813,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3742,7 +3837,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3757,7 +3853,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          median_image=MedianFilterImage(msl_info->image[n],geometry_info.rho,
+          median_image=StatisticImage(msl_info->image[n],MedianStatistic,
+            (size_t) geometry_info.rho,(size_t) geometry_info.sigma,
             &msl_info->image[n]->exception);
           if (median_image == (Image *) NULL)
             break;
@@ -3784,7 +3881,8 @@ static void MSLStartElement(void *context,const xmlChar *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);
             }
@@ -3820,7 +3918,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3829,12 +3928,14 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"blackness") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   if (LocaleCompare(keyword,"brightness") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3858,7 +3959,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"hue") == 0)
                     {
-                      geometry_info.xi=atof(value);
+                      geometry_info.xi=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3870,7 +3972,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"lightness") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3882,7 +3985,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"saturation") == 0)
                     {
-                      geometry_info.sigma=atof(value);
+                      geometry_info.sigma=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3894,7 +3998,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"whiteness") == 0)
                     {
-                      geometry_info.sigma=atof(value);
+                      geometry_info.sigma=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -3909,9 +4014,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (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->image[n]->exception);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
@@ -3939,7 +4045,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -3964,7 +4071,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"gray") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -3984,7 +4091,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) NegateImageChannel(msl_info->image[n],channel,gray);
+          channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+          (void) NegateImage(msl_info->image[n],gray,
+            &msl_info->image[n]->exception);
+          (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
           break;
         }
       if (LocaleCompare((const char *) tag,"normalize") == 0)
@@ -4003,7 +4113,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -4031,7 +4142,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) NormalizeImageChannel(msl_info->image[n],channel);
+          (void) NormalizeImage(msl_info->image[n],
+            &msl_info->image[n]->exception);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
@@ -4058,7 +4170,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -4081,7 +4194,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4097,7 +4211,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           paint_image=OilPaintImage(msl_info->image[n],geometry_info.rho,
-            &msl_info->image[n]->exception);
+            geometry_info.sigma,&msl_info->image[n]->exception);
           if (paint_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -4106,7 +4220,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
       if (LocaleCompare((const char *) tag,"opaque") == 0)
         {
-          MagickPixelPacket
+          PixelInfo
             fill_color,
             target;
 
@@ -4119,14 +4233,17 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 (const char *) tag);
               break;
             }
-          (void) QueryMagickColor("none",&target,&exception);
-          (void) QueryMagickColor("none",&fill_color,&exception);
+          (void) QueryMagickColorCompliance("none",AllCompliance,&target,
+            &exception);
+          (void) QueryMagickColorCompliance("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)
               {
@@ -4151,12 +4268,14 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"fill") == 0)
                     {
-                      (void) QueryMagickColor(value,&fill_color,&exception);
+                      (void) QueryMagickColorCompliance(value,AllCompliance,
+                        &fill_color,&exception);
                       break;
                     }
                   if (LocaleCompare(keyword,"fuzz") == 0)
                     {
-                      msl_info->image[n]->fuzz=atof(value);
+                      msl_info->image[n]->fuzz=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4171,8 +4290,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) OpaquePaintImageChannel(msl_info->image[n],channel,
-            &target,&fill_color,MagickFalse);
+          channel_mask=SetPixelChannelMask(msl_info->image[n],channel);
+          (void) OpaquePaintImage(msl_info->image[n],&target,&fill_color,
+            MagickFalse,&msl_info->image[n]->exception);
+          (void) SetPixelChannelMap(msl_info->image[n],channel_mask);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
@@ -4188,7 +4309,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
             {
@@ -4197,7 +4319,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               {
                 if (LocaleCompare(keyword,"output") == 0)
                   {
-                    (void) fprintf(stdout,"%s",value);
+                    (void) FormatLocaleFile(stdout,"%s",value);
                     break;
                   }
                 ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -4212,6 +4334,108 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           }
           break;
         }
+        if (LocaleCompare((const char *) tag, "profile") == 0)
+          {
+            if (msl_info->image[n] == (Image *) NULL)
+              {
+                ThrowMSLException(OptionError,"NoImagesDefined",
+                  (const char *) tag);
+                break;
+              }
+            if (attributes == (const xmlChar **) NULL)
+              break;
+            for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
+            {
+              const char
+                *name;
+
+              const StringInfo
+                *profile;
+
+              Image
+                *profile_image;
+
+              ImageInfo
+                *profile_info;
+
+              keyword=(const char *) attributes[i++];
+              attribute=InterpretImageProperties(msl_info->image_info[n],
+                msl_info->attributes[n],(const char *) attributes[i],
+                &exception);
+              CloneString(&value,attribute);
+              if (*keyword == '+')
+                {
+                  /*
+                    Remove a profile from the image.
+                  */
+                  (void) ProfileImage(msl_info->image[n],keyword,
+                    (const unsigned char *) NULL,0,MagickTrue);
+                  continue;
+                }
+              /*
+                Associate a profile with the image.
+              */
+              profile_info=CloneImageInfo(msl_info->image_info[n]);
+              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_info=DestroyImageInfo(profile_info);
+              if (profile_image == (Image *) NULL)
+                {
+                  char
+                    name[MaxTextExtent],
+                    filename[MaxTextExtent];
+
+                  register char
+                    *p;
+
+                  StringInfo
+                    *profile;
+
+                  (void) CopyMagickString(filename,keyword,MaxTextExtent);
+                  (void) CopyMagickString(name,keyword,MaxTextExtent);
+                  for (p=filename; *p != '\0'; p++)
+                    if ((*p == ':') && (IsPathDirectory(keyword) < 0) &&
+                        (IsPathAccessible(keyword) == MagickFalse))
+                      {
+                        register char
+                          *q;
+
+                        /*
+                          Look for profile name (e.g. name:profile).
+                        */
+                        (void) CopyMagickString(name,filename,(size_t)
+                          (p-filename+1));
+                        for (q=filename; *q != '\0'; q++)
+                          *q=(*++p);
+                        break;
+                      }
+                  profile=FileToStringInfo(filename,~0UL,&exception);
+                  if (profile != (StringInfo *) NULL)
+                    {
+                      (void) ProfileImage(msl_info->image[n],name,
+                        GetStringInfoDatum(profile),(size_t)
+                        GetStringInfoLength(profile),MagickFalse);
+                      profile=DestroyStringInfo(profile);
+                    }
+                  continue;
+                }
+              ResetImageProfileIterator(profile_image);
+              name=GetNextImageProfile(profile_image);
+              while (name != (const char *) NULL)
+              {
+                profile=GetImageProfile(profile_image,name);
+                if (profile != (StringInfo *) NULL)
+                  (void) ProfileImage(msl_info->image[n],name,
+                    GetStringInfoDatum(profile),(size_t)
+                    GetStringInfoLength(profile),MagickFalse);
+                name=GetNextImageProfile(profile_image);
+              }
+              profile_image=DestroyImage(profile_image);
+            }
+            break;
+          }
       ThrowMSLException(OptionError,"UnrecognizedElement",(const char *) tag);
     }
     case 'Q':
@@ -4237,7 +4461,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -4246,12 +4471,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"colors") == 0)
                     {
-                      quantize_info.number_colors=atol(value);
+                      quantize_info.number_colors=StringToLong(value);
                       break;
                     }
                   if (LocaleCompare(keyword,"colorspace") == 0)
                     {
-                      option=ParseMagickOption(MagickColorspaceOptions,
+                      option=ParseCommandOption(MagickColorspaceOptions,
                         MagickFalse,value);
                       if (option < 0)
                         ThrowMSLException(OptionError,
@@ -4268,7 +4493,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"dither") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -4285,7 +4510,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"measure") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -4302,7 +4527,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"treedepth") == 0)
                     {
-                      quantize_info.tree_depth=atol(value);
+                      quantize_info.tree_depth=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4317,7 +4542,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (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)
@@ -4344,7 +4569,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -4357,27 +4583,27 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                         *p;
 
                       p=value;
-                      draw_info->affine.sx=strtod(p,&p);
+                      draw_info->affine.sx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.rx=strtod(p,&p);
+                      draw_info->affine.rx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.ry=strtod(p,&p);
+                      draw_info->affine.ry=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.sy=strtod(p,&p);
+                      draw_info->affine.sy=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.tx=strtod(p,&p);
+                      draw_info->affine.tx=InterpretLocaleValue(p,&p);
                       if (*p ==',')
                         p++;
-                      draw_info->affine.ty=strtod(p,&p);
+                      draw_info->affine.ty=InterpretLocaleValue(p,&p);
                       break;
                     }
                   if (LocaleCompare(keyword,"align") == 0)
                     {
-                      option=ParseMagickOption(MagickAlignOptions,MagickFalse,
+                      option=ParseCommandOption(MagickAlignOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedAlignType",
@@ -4387,7 +4613,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"antialias") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedBooleanType",
@@ -4429,8 +4655,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   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)
@@ -4460,7 +4686,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"gravity") == 0)
                     {
-                      option=ParseMagickOption(MagickGravityOptions,MagickFalse,
+                      option=ParseCommandOption(MagickGravityOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedGravityType",
@@ -4477,7 +4703,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"pointsize") == 0)
                     {
-                      draw_info->pointsize=atof(value);
+                      draw_info->pointsize=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4489,7 +4716,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"rotate") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(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))));
@@ -4514,20 +4741,20 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"skewX") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(value,(char **) NULL);
                       affine.ry=cos(DegreesToRadians(fmod(angle,360.0)));
                       break;
                     }
                   if (LocaleCompare(keyword,"skewY") == 0)
                     {
-                      angle=atof(value);
+                      angle=InterpretLocaleValue(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);
@@ -4536,18 +4763,18 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   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)
                     {
-                      draw_info->stroke_width=atol(value);
+                      draw_info->stroke_width=StringToLong(value);
                       break;
                     }
                   if (LocaleCompare(keyword,"style") == 0)
                     {
-                      option=ParseMagickOption(MagickStyleOptions,MagickFalse,
+                      option=ParseCommandOption(MagickStyleOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedStyleType",
@@ -4585,8 +4812,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword, "undercolor") == 0)
                     {
-                      (void) QueryColorDatabase(value,&draw_info->undercolor,
-                        &exception);
+                      (void) QueryColorCompliance(value,AllCompliance,
+                        &draw_info->undercolor,&exception);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4598,7 +4825,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"weight") == 0)
                     {
-                      draw_info->weight=atol(value);
+                      draw_info->weight=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4610,7 +4837,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4622,7 +4849,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4637,28 +4864,30 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
-            geometry.width,geometry.height,geometry.x,geometry.y);
+          (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->image[n]->exception);
           if (status != MagickFalse)
             {
               Image
                 *image;
 
               image=msl_info->attributes[n];
-              FormatImageProperty(image,"msl:font-metrics.pixels_per_em.x","%g",
-                metrics.pixels_per_em.x);
-              FormatImageProperty(image,"msl:font-metrics.pixels_per_em.y","%g",
-                metrics.pixels_per_em.y);
+              FormatImageProperty(image,"msl:font-metrics.pixels_per_em.x",
+                "%g",metrics.pixels_per_em.x);
+              FormatImageProperty(image,"msl:font-metrics.pixels_per_em.y",
+                "%g",metrics.pixels_per_em.y);
               FormatImageProperty(image,"msl:font-metrics.ascent","%g",
                 metrics.ascent);
               FormatImageProperty(image,"msl:font-metrics.descent","%g",
@@ -4711,7 +4940,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -4735,7 +4965,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=atol(value);
+                      geometry.height=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4747,7 +4977,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"raise") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedNoiseType",
@@ -4764,7 +4994,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4779,7 +5009,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) RaiseImage(msl_info->image[n],&geometry,raise);
+          (void) RaiseImage(msl_info->image[n],&geometry,raise,
+            &msl_info->image[n]->exception);
           break;
         }
       if (LocaleCompare((const char *) tag,"read") == 0)
@@ -4790,7 +5021,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             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':
@@ -4810,51 +5041,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     AppendImageToList(&msl_info->image[n],image);
                     break;
                   }
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-                break;
-              }
-              case 'G':
-              case 'g':
-              {
-                if (LocaleCompare(keyword,"gravity") == 0)
-                  {
-                    option=ParseMagickOption(MagickGravityOptions,MagickFalse,
-                      value);
-                    if (option < 0)
-                      ThrowMSLException(OptionError,"UnrecognizedGravityType",
-                        value);
-                    (void) SetImageOption(msl_info->image_info[n],keyword,
-                      value);
-                    break;
-                  }
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-                break;
-              }
-              case 'P':
-              case 'p':
-              {
-                if (LocaleCompare(keyword,"pointsize") == 0)
-                  {
-                    msl_info->image_info[n]->pointsize=atof(value);
-                    break;
-                  }
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-                break;
-              }
-              case 'S':
-              case 's':
-              {
-                if (LocaleCompare(keyword,"size") == 0)
-                  {
-                    msl_info->image_info[n]->size=AcquireString(value);
-                    break;
-                  }
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+                (void) SetMSLAttributes(msl_info,keyword,value);
                 break;
               }
               default:
               {
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+                (void) SetMSLAttributes(msl_info,keyword,value);
                 break;
               }
             }
@@ -4880,7 +5072,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -4903,7 +5096,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -4918,7 +5112,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          paint_image=ReduceNoiseImage(msl_info->image[n],geometry_info.rho,
+          paint_image=StatisticImage(msl_info->image[n],NonpeakStatistic,
+            (size_t) geometry_info.rho,(size_t) geometry_info.sigma,
             &msl_info->image[n]->exception);
           if (paint_image == (Image *) NULL)
             break;
@@ -4946,7 +5141,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -5000,7 +5195,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"height") == 0)
             {
-            height = atol( value );
+            height = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5011,7 +5206,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"width") == 0)
             {
-            width = atol( value );
+            width = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5022,7 +5217,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"x") == 0)
             {
-            x = atol( value );
+            x = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5033,7 +5228,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"y") == 0)
             {
-            y = atol( value );
+            y = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5073,14 +5268,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
       {
         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=atof(value);
+                msl_info->image[n]->blur=InterpretLocaleValue(value,
+                        (char **) NULL);
                 break;
               }
             ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5091,7 +5287,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             if (LocaleCompare(keyword,"geometry") == 0)
               {
-                long
+                ssize_t
                   flags;
 
                 flags=ParseGeometry(value,&geometry_info);
@@ -5109,7 +5305,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             if (LocaleCompare(keyword,"x-resolution") == 0)
               {
-                x_resolution=atof(value);
+                x_resolution=InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
             ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5120,7 +5316,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             if (LocaleCompare(keyword,"y-resolution") == 0)
               {
-                y_resolution=atof(value);
+                y_resolution=InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
             ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5146,10 +5342,10 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         factor=1.0;
         if (msl_info->image[n]->units == PixelsPerCentimeterResolution)
           factor=2.54;
-        width=(unsigned long) (x_resolution*msl_info->image[n]->columns/
+        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);
-        height=(unsigned long) (y_resolution*msl_info->image[n]->rows/
+        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);
         resample_image=ResizeImage(msl_info->image[n],width,height,
@@ -5189,7 +5385,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5198,7 +5395,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"filter") == 0)
                     {
-                      option=ParseMagickOption(MagickFilterOptions,MagickFalse,
+                      option=ParseCommandOption(MagickFilterOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedNoiseType",
@@ -5228,7 +5425,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=(unsigned long) atol(value);
+                      geometry.height=StringToUnsignedLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5240,7 +5437,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"support") == 0)
                     {
-                      blur=atof(value);
+                      blur=InterpretLocaleValue(value,(char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5252,7 +5449,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5295,7 +5492,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5319,7 +5517,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry.x=atol(value);
+                      geometry.x=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5331,7 +5529,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry.y=atol(value);
+                      geometry.y=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5373,7 +5571,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -5392,7 +5590,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"x") == 0)
             {
-            x = atol( value );
+            x = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5403,7 +5601,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"y") == 0)
             {
-            y = atol( value );
+            y = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5452,7 +5650,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5461,7 +5660,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"degrees") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5515,7 +5715,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -5523,7 +5723,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"degrees") == 0)
             {
-            degrees = atof( value );
+            degrees = InterpretLocaleValue(value,(char **) NULL);
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -5577,7 +5777,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5599,7 +5800,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=(unsigned long) atol(value);
+                      geometry.height=StringToUnsignedLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5611,7 +5812,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5653,7 +5854,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5675,7 +5877,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"height") == 0)
                     {
-                      geometry.height=(unsigned long) atol(value);
+                      geometry.height=StringToUnsignedLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5687,7 +5889,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"width") == 0)
                     {
-                      geometry.width=atol(value);
+                      geometry.width=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5736,7 +5938,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5745,12 +5948,13 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"cluster-threshold") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   if (LocaleCompare(keyword,"colorspace") == 0)
                     {
-                      option=ParseMagickOption(MagickColorspaceOptions,
+                      option=ParseCommandOption(MagickColorspaceOptions,
                         MagickFalse,value);
                       if (option < 0)
                         ThrowMSLException(OptionError,
@@ -5781,7 +5985,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"smoothing-threshold") == 0)
                     {
-                      geometry_info.sigma=atof(value);
+                      geometry_info.sigma=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5797,15 +6002,14 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           (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;
         }
 
@@ -5815,7 +6019,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
           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':
@@ -5831,7 +6035,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     property=GetImageProperty(msl_info->attributes[j],"id");
                     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;
                       }
                   }
@@ -5847,7 +6052,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     property=GetImageProperty(msl_info->attributes[j],"id");
                     if (LocaleCompare(property,value) == 0)
                       {
-                        SetImageClipMask(msl_info->image[n],msl_info->image[j]);
+                        SetImageClipMask(msl_info->image[n],msl_info->image[j],
+                          &exception);
                         break;
                       }
                   }
@@ -5855,19 +6061,20 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               if (LocaleCompare(keyword,"colorspace") == 0)
                 {
-                  long
+                  ssize_t
                     colorspace;
 
-                  colorspace=(ColorspaceType) ParseMagickOption(
-                    MagickColorspaceOptions,MagickFalse,keyword);
+                  colorspace=(ColorspaceType) ParseCommandOption(
+                    MagickColorspaceOptions,MagickFalse,value);
                   if (colorspace < 0)
-                    ThrowMSLException(OptionError,"Unrecognized colorspace",
+                    ThrowMSLException(OptionError,"UnrecognizedColorspace",
                       value);
                   (void) TransformImageColorspace(msl_info->image[n],
                     (ColorspaceType) colorspace);
                   break;
                 }
               (void) SetMSLAttributes(msl_info,keyword,value);
+              (void) SetImageProperty(msl_info->image[n],keyword,value);
               break;
             }
             case 'D':
@@ -5884,6 +6091,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                   break;
                 }
               (void) SetMSLAttributes(msl_info,keyword,value);
+              (void) SetImageProperty(msl_info->image[n],keyword,value);
               break;
             }
             case 'O':
@@ -5891,20 +6099,21 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword, "opacity") == 0)
                 {
-                  long  opac = OpaqueOpacity,
-                  len = (long) strlen( value );
+                  ssize_t  opac = OpaqueAlpha,
+                  len = (ssize_t) strlen( value );
 
                   if (value[len-1] == '%') {
                     char  tmp[100];
                     (void) CopyMagickString(tmp,value,len);
-                    opac = atol( tmp );
+                    opac = StringToLong( tmp );
                     opac = (int)(QuantumRange * ((float)opac/100));
                   } else
-                    opac = atol( value );
+                    opac = StringToLong( value );
                   (void) SetImageOpacity( msl_info->image[n], (Quantum) opac );
                   break;
               }
               (void) SetMSLAttributes(msl_info,keyword,value);
+              (void) SetImageProperty(msl_info->image[n],keyword,value);
               break;
             }
             case 'P':
@@ -5929,21 +6138,25 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 if (image_option != (const char *) NULL)
                   flags=ParseAbsoluteGeometry(image_option,&geometry);
                 flags=ParseAbsoluteGeometry(value,&geometry);
-                (void) FormatMagickString(page,MaxTextExtent,"%lux%lu",
-                  geometry.width,geometry.height);
+                (void) FormatLocaleString(page,MaxTextExtent,"%.20gx%.20g",
+                  (double) geometry.width,(double) geometry.height);
                 if (((flags & XValue) != 0) || ((flags & YValue) != 0))
-                  (void) FormatMagickString(page,MaxTextExtent,"%lux%lu%+ld%+ld",
-                    geometry.width,geometry.height,geometry.x,geometry.y);
+                  (void) FormatLocaleString(page,MaxTextExtent,
+                    "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,
+                    (double) geometry.height,(double) geometry.x,(double)
+                    geometry.y);
                 (void) SetImageOption(msl_info->image_info[n],keyword,page);
                 msl_info->image_info[n]->page=GetPageGeometry(page);
                 break;
               }
               (void) SetMSLAttributes(msl_info,keyword,value);
+              (void) SetImageProperty(msl_info->image[n],keyword,value);
               break;
             }
             default:
             {
               (void) SetMSLAttributes(msl_info,keyword,value);
+              (void) SetImageProperty(msl_info->image[n],keyword,value);
               break;
             }
           }
@@ -5973,7 +6186,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -5982,7 +6196,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"azimuth") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -5994,7 +6209,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"elevation") == 0)
                     {
-                      geometry_info.sigma=atof(value);
+                      geometry_info.sigma=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6013,7 +6229,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     }
                   if (LocaleCompare(keyword,"gray") == 0)
                     {
-                      option=ParseMagickOption(MagickBooleanOptions,MagickFalse,
+                      option=ParseCommandOption(MagickBooleanOptions,MagickFalse,
                         value);
                       if (option < 0)
                         ThrowMSLException(OptionError,"UnrecognizedNoiseType",
@@ -6060,7 +6276,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6083,7 +6300,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"opacity") == 0)
                     {
-                      geometry_info.rho=atol(value);
+                      geometry_info.rho=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6095,7 +6312,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"sigma") == 0)
                     {
-                      geometry_info.sigma=atol(value);
+                      geometry_info.sigma=StringToLong(value);
                       break;
                     }
                   break;
@@ -6105,7 +6322,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry_info.xi=atof(value);
+                      geometry_info.xi=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6117,7 +6335,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry_info.psi=atol(value);
+                      geometry_info.psi=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6133,8 +6351,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           shadow_image=ShadowImage(msl_info->image[n],geometry_info.rho,
-            geometry_info.sigma,(long) (geometry_info.xi+0.5),(long)
-            (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->image[n]->exception);
           if (shadow_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -6143,7 +6361,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
       if (LocaleCompare((const char *) tag,"sharpen") == 0)
       {
-        double  radius = 0.0,
+        double bias = 0.0,
+            radius = 0.0,
             sigma = 1.0;
 
         if (msl_info->image[n] == (Image *) NULL)
@@ -6161,15 +6380,26 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           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':
+            case 'b':
+            {
+              if (LocaleCompare(keyword, "bias") == 0)
+              {
+                bias = InterpretLocaleValue(value,(char **) NULL);
+                break;
+              }
+              ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+              break;
+            }
             case 'R':
             case 'r':
             {
               if (LocaleCompare(keyword, "radius") == 0)
               {
-                radius = atof( value );
+                radius = InterpretLocaleValue(value,(char **) NULL);
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6180,7 +6410,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword,"sigma") == 0)
               {
-                sigma = atol( value );
+                sigma = StringToLong( value );
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6202,7 +6432,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         Image
           *newImage;
 
-        newImage=SharpenImage(msl_info->image[n],radius,sigma,&msl_info->image[n]->exception);
+        newImage=SharpenImage(msl_info->image[n],radius,sigma,bias,
+          &msl_info->image[n]->exception);
         if (newImage == (Image *) NULL)
           break;
         msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -6228,7 +6459,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -6247,7 +6478,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"height") == 0)
             {
-            height = atol( value );
+            height = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6258,7 +6489,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"width") == 0)
             {
-            width = atol( value );
+            width = StringToLong( value );
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6316,7 +6547,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6325,7 +6557,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword, "fill") == 0)
                     {
-                      (void) QueryColorDatabase(value,
+                      (void) QueryColorCompliance(value,AllCompliance,
                         &msl_info->image[n]->background_color,&exception);
                       break;
                     }
@@ -6352,7 +6584,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"x") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6364,7 +6597,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"y") == 0)
                     {
-                      geometry_info.sigma=atol(value);
+                      geometry_info.sigma=StringToLong(value);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6403,7 +6636,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6415,7 +6649,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) SignatureImage(msl_info->image[n]);
+          (void) SignatureImage(msl_info->image[n],&exception);
           break;
         }
       if (LocaleCompare((const char *) tag,"solarize") == 0)
@@ -6435,7 +6669,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6456,7 +6691,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"threshold") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6471,7 +6707,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 }
               }
             }
-          (void) SolarizeImage(msl_info->image[n],geometry_info.rho);
+          (void) SolarizeImage(msl_info->image[n],geometry_info.rho,
+            &msl_info->image[n]->exception);
           break;
         }
       if (LocaleCompare((const char *) tag,"spread") == 0)
@@ -6493,7 +6730,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6516,7 +6754,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"radius") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6532,7 +6771,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
-            &msl_info->image[n]->exception);
+            msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
           if (spread_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -6556,7 +6795,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -6620,7 +6859,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -6675,7 +6914,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             *q,
             *swap;
 
-          long
+          ssize_t
             index,
             swap_index;
 
@@ -6692,7 +6931,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6702,9 +6942,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                   if (LocaleCompare(keyword,"indexes") == 0)
                     {
                       flags=ParseGeometry(value,&geometry_info);
-                      index=(long) geometry_info.rho;
+                      index=(ssize_t) geometry_info.rho;
                       if ((flags & SigmaValue) == 0)
-                        swap_index=(long) geometry_info.sigma;
+                        swap_index=(ssize_t) geometry_info.sigma;
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6754,7 +6994,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6763,7 +7004,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 {
                   if (LocaleCompare(keyword,"degrees") == 0)
                     {
-                      geometry_info.rho=atof(value);
+                      geometry_info.rho=InterpretLocaleValue(value,
+                        (char **) NULL);
                       break;
                     }
                   ThrowMSLException(OptionError,"UnrecognizedAttribute",
@@ -6793,7 +7035,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
               }
             }
           swirl_image=SwirlImage(msl_info->image[n],geometry_info.rho,
-            &msl_info->image[n]->exception);
+            msl_info->image[n]->interpolate,&msl_info->image[n]->exception);
           if (swirl_image == (Image *) NULL)
             break;
           msl_info->image[n]=DestroyImage(msl_info->image[n]);
@@ -6816,7 +7058,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6856,7 +7099,8 @@ static void MSLStartElement(void *context,const xmlChar *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)
               {
@@ -6908,7 +7152,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
         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':
@@ -6916,7 +7160,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
           if (LocaleCompare(keyword,"threshold") == 0)
             {
-            threshold = atof( value );
+            threshold = InterpretLocaleValue(value,(char **) NULL);
             break;
             }
           ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -6934,9 +7178,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           process image.
         */
         {
-        BilevelImageChannel(msl_info->image[n],
-          (ChannelType) ((long) (AllChannels &~ (long) OpacityChannel)),
-          threshold);
+          BilevelImage(msl_info->image[n],threshold);
         break;
         }
       }
@@ -6953,7 +7195,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         {
           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':
@@ -6961,12 +7203,13 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               if (LocaleCompare(keyword,"color") == 0)
               {
-                MagickPixelPacket
+                PixelInfo
                   target;
 
-                (void) QueryMagickColor(value,&target,&exception);
+                (void) QueryMagickColorCompliance(value,AllCompliance,&target,
+                  &exception);
                 (void) TransparentPaintImage(msl_info->image[n],&target,
-                  TransparentOpacity,MagickFalse);
+                  TransparentAlpha,MagickFalse,&msl_info->image[n]->exception);
                 break;
               }
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -7029,7 +7272,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             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':
@@ -7041,23 +7284,11 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       MaxTextExtent);
                     break;
                   }
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-              }
-              case 'Q':
-              case 'q':
-              {
-                if (LocaleCompare(keyword,"quality") == 0)
-                  {
-                    msl_info->image_info[n]->quality=atol(value);
-                    msl_info->image[n]->quality=
-                      msl_info->image_info[n]->quality;
-                    break;
-                  }
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+                (void) SetMSLAttributes(msl_info,keyword,value);
               }
               default:
               {
-                ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+                (void) SetMSLAttributes(msl_info,keyword,value);
                 break;
               }
             }
@@ -7065,7 +7296,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
           /* 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->image[n]->exception);
             break;
           }
         }
@@ -7084,7 +7316,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
 static void MSLEndElement(void *context,const xmlChar *tag)
 {
-  long
+  ssize_t
     n;
 
   MSLInfo
@@ -7121,7 +7353,7 @@ static void MSLEndElement(void *context,const xmlChar *tag)
       {
         if (msl_info->group_info[msl_info->number_groups-1].numImages > 0 )
         {
-          long  i = (long)
+          ssize_t  i = (ssize_t)
             (msl_info->group_info[msl_info->number_groups-1].numImages);
           while ( i-- )
           {
@@ -7186,7 +7418,7 @@ static void MSLCharacters(void *context,const xmlChar *c,int length)
   register char
     *p;
 
-  register long
+  register ssize_t
     i;
 
   /*
@@ -7202,7 +7434,7 @@ static void MSLCharacters(void *context,const xmlChar *c,int length)
   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)
@@ -7248,6 +7480,7 @@ static void MSLIgnorableWhitespace(void *context,const xmlChar *c,int length)
   (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,
@@ -7263,6 +7496,7 @@ 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)
@@ -7276,6 +7510,7 @@ 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,...)
@@ -7298,6 +7533,7 @@ 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
@@ -7328,6 +7564,7 @@ static void MSLError(void *context,const char *format,...)
   (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
@@ -7354,6 +7591,7 @@ static void MSLCDataBlock(void *context,const xmlChar *value,int length)
   (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))
@@ -7387,6 +7625,7 @@ static void MSLExternalSubset(void *context,const xmlChar *name,
     (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) ||
@@ -7437,38 +7676,6 @@ static void MSLExternalSubset(void *context,const xmlChar *name,
 static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **image,
   ExceptionInfo *exception)
 {
-  xmlSAXHandler
-    SAXModules =
-    {
-      MSLInternalSubset,
-      MSLIsStandalone,
-      MSLHasInternalSubset,
-      MSLHasExternalSubset,
-      MSLResolveEntity,
-      MSLGetEntity,
-      MSLEntityDeclaration,
-      MSLNotationDeclaration,
-      MSLAttributeDeclaration,
-      MSLElementDeclaration,
-      MSLUnparsedEntityDeclaration,
-      MSLSetDocumentLocator,
-      MSLStartDocument,
-      MSLEndDocument,
-      MSLStartElement,
-      MSLEndElement,
-      MSLReference,
-      MSLCharacters,
-      MSLIgnorableWhitespace,
-      MSLProcessingInstructions,
-      MSLComment,
-      MSLWarning,
-      MSLError,
-      MSLError,
-      MSLGetParameterEntity,
-      MSLCDataBlock,
-      MSLExternalSubset
-    };
-
   char
     message[MaxTextExtent];
 
@@ -7478,14 +7685,17 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **im
   int
     status;
 
-  long
+  ssize_t
     n;
 
   MSLInfo
     msl_info;
 
+  xmlSAXHandler
+    sax_modules;
+
   xmlSAXHandlerPtr
-    SAXHandler;
+    sax_handler;
 
   /*
     Open image file.
@@ -7493,9 +7703,10 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **im
   assert(image_info != (const ImageInfo *) NULL);
   assert(image_info->signature == MagickSignature);
   if (image_info->debug != MagickFalse)
-    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image_info->filename);
+    (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)
     {
@@ -7529,19 +7740,47 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **im
       "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;
   if (*image != (Image *) NULL)
     MSLPushImage(&msl_info,*image);
   (void) xmlSubstituteEntitiesDefault(1);
-  SAXHandler=(&SAXModules);
-  msl_info.parser=xmlCreatePushParserCtxt(SAXHandler,&msl_info,(char *) NULL,0,
+  (void) ResetMagickMemory(&sax_modules,0,sizeof(sax_modules));
+  sax_modules.internalSubset=MSLInternalSubset;
+  sax_modules.isStandalone=MSLIsStandalone;
+  sax_modules.hasInternalSubset=MSLHasInternalSubset;
+  sax_modules.hasExternalSubset=MSLHasExternalSubset;
+  sax_modules.resolveEntity=MSLResolveEntity;
+  sax_modules.getEntity=MSLGetEntity;
+  sax_modules.entityDecl=MSLEntityDeclaration;
+  sax_modules.notationDecl=MSLNotationDeclaration;
+  sax_modules.attributeDecl=MSLAttributeDeclaration;
+  sax_modules.elementDecl=MSLElementDeclaration;
+  sax_modules.unparsedEntityDecl=MSLUnparsedEntityDeclaration;
+  sax_modules.setDocumentLocator=MSLSetDocumentLocator;
+  sax_modules.startDocument=MSLStartDocument;
+  sax_modules.endDocument=MSLEndDocument;
+  sax_modules.startElement=MSLStartElement;
+  sax_modules.endElement=MSLEndElement;
+  sax_modules.reference=MSLReference;
+  sax_modules.characters=MSLCharacters;
+  sax_modules.ignorableWhitespace=MSLIgnorableWhitespace;
+  sax_modules.processingInstruction=MSLProcessingInstructions;
+  sax_modules.comment=MSLComment;
+  sax_modules.warning=MSLWarning;
+  sax_modules.error=MSLError;
+  sax_modules.fatalError=MSLError;
+  sax_modules.getParameterEntity=MSLGetParameterEntity;
+  sax_modules.cdataBlock=MSLCDataBlock;
+  sax_modules.externalSubset=MSLExternalSubset;
+  sax_handler=(&sax_modules);
+  msl_info.parser=xmlCreatePushParserCtxt(sax_handler,&msl_info,(char *) NULL,0,
     msl_image->filename);
   while (ReadBlobString(msl_image,message) != (char *) NULL)
   {
-    n=(long) strlen(message);
+    n=(ssize_t) strlen(message);
     if (n == 0)
       continue;
     status=xmlParseChunk(msl_info.parser,message,(int) n,MagickFalse);
@@ -7560,7 +7799,9 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **im
     msl_info.group_info);
   if (*image == (Image *) NULL)
     *image=(*msl_info.image);
-  return((MagickBooleanType) ((*msl_info.image)->exception.severity == UndefinedException));
+  if ((*msl_info.image)->exception.severity != UndefinedException)
+    return(MagickFalse);
+  return(MagickTrue);
 }
 
 static Image *ReadMSLImage(const ImageInfo *image_info,ExceptionInfo *exception)
@@ -7604,10 +7845,10 @@ static Image *ReadMSLImage(const ImageInfo *image_info,ExceptionInfo *exception)
 %
 %  The format of the RegisterMSLImage method is:
 %
-%      unsigned long RegisterMSLImage(void)
+%      size_t RegisterMSLImage(void)
 %
 */
-ModuleExport unsigned long RegisterMSLImage(void)
+ModuleExport size_t RegisterMSLImage(void)
 {
   MagickInfo
     *entry;
@@ -7623,6 +7864,7 @@ ModuleExport unsigned long RegisterMSLImage(void)
   return(MagickImageCoderSignature);
 }
 \f
+#if defined(MAGICKCORE_XML_DELEGATE)
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -7653,16 +7895,28 @@ ModuleExport unsigned long RegisterMSLImage(void)
 static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
   const char *value)
 {
+  Image
+    *attributes;
+
   DrawInfo
     *draw_info;
 
   ExceptionInfo
     *exception;
 
+  GeometryInfo
+    geometry_info;
+
+  Image
+    *image;
+
   ImageInfo
     *image_info;
 
-  long
+  int
+    flags;
+
+  ssize_t
     n;
 
   assert(msl_info != (MSLInfo *) NULL);
@@ -7672,23 +7926,106 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
     return(MagickTrue);
   exception=msl_info->exception;
   n=msl_info->n;
+  attributes=msl_info->attributes[n];
   image_info=msl_info->image_info[n];
   draw_info=msl_info->draw_info[n];
+  image=msl_info->image[n];
   switch (*keyword)
   {
+    case 'A':
+    case 'a':
+    {
+      if (LocaleCompare(keyword,"adjoin") == 0)
+        {
+          ssize_t
+            adjoin;
+
+          adjoin=ParseCommandOption(MagickBooleanOptions,MagickFalse,value);
+          if (adjoin < 0)
+            ThrowMSLException(OptionError,"UnrecognizedType",value);
+          image_info->adjoin=(MagickBooleanType) adjoin;
+          break;
+        }
+      if (LocaleCompare(keyword,"alpha") == 0)
+        {
+          ssize_t
+            alpha;
+
+          alpha=ParseCommandOption(MagickAlphaOptions,MagickFalse,value);
+          if (alpha < 0)
+            ThrowMSLException(OptionError,"UnrecognizedType",value);
+          if (image != (Image *) NULL)
+            (void) SetImageAlphaChannel(image,(AlphaChannelType) alpha,
+              exception);
+          break;
+        }
+      if (LocaleCompare(keyword,"antialias") == 0)
+        {
+          ssize_t
+            antialias;
+
+          antialias=ParseCommandOption(MagickBooleanOptions,MagickFalse,value);
+          if (antialias < 0)
+            ThrowMSLException(OptionError,"UnrecognizedGravityType",value);
+          image_info->antialias=(MagickBooleanType) antialias;
+          break;
+        }
+      if (LocaleCompare(keyword,"area-limit") == 0)
+        {
+          MagickSizeType
+            limit;
+
+          limit=MagickResourceInfinity;
+          if (LocaleCompare(value,"unlimited") != 0)
+            limit=(MagickSizeType) SiPrefixToDouble(value,100.0);
+          (void) SetMagickResourceLimit(AreaResource,limit);
+          break;
+        }
+      if (LocaleCompare(keyword,"attenuate") == 0)
+        {
+          (void) SetImageOption(image_info,keyword,value);
+          break;
+        }
+      if (LocaleCompare(keyword,"authenticate") == 0)
+        {
+          (void) CloneString(&image_info->density,value);
+          break;
+        }
+      ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+      break;
+    }
     case 'B':
     case 'b':
     {
       if (LocaleCompare(keyword,"background") == 0)
         {
-          (void) QueryColorDatabase(value,&image_info->background_color,
-            exception);
+          (void) QueryColorCompliance(value,AllCompliance,
+            &image_info->background_color,exception);
+          break;
+        }
+      if (LocaleCompare(keyword,"bias") == 0)
+        {
+          if (image == (Image *) NULL)
+            break;
+          image->bias=SiPrefixToDouble(value,QuantumRange);
+          break;
+        }
+      if (LocaleCompare(keyword,"blue-primary") == 0)
+        {
+          if (image == (Image *) NULL)
+            break;
+          flags=ParseGeometry(value,&geometry_info);
+          image->chromaticity.blue_primary.x=geometry_info.rho;
+          image->chromaticity.blue_primary.y=geometry_info.sigma;
+          if ((flags & SigmaValue) == 0)
+            image->chromaticity.blue_primary.y=
+              image->chromaticity.blue_primary.x;
           break;
         }
       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);
@@ -7711,7 +8048,31 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *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;
+        }
+      if (LocaleCompare(keyword,"filename") == 0)
+        {
+          (void) CopyMagickString(image_info->filename,value,MaxTextExtent);
+          break;
+        }
+      ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+      break;
+    }
+    case 'G':
+    case 'g':
+    {
+      if (LocaleCompare(keyword,"gravity") == 0)
+        {
+          ssize_t
+            gravity;
+
+          gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,value);
+          if (gravity < 0)
+            ThrowMSLException(OptionError,"UnrecognizedGravityType",value);
+          (void) SetImageOption(image_info,keyword,value);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -7722,8 +8083,7 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
     {
       if (LocaleCompare(keyword,"id") == 0)
         {
-          (void) SetImageProperty(msl_info->attributes[n],keyword,NULL);
-          (void) SetImageProperty(msl_info->attributes[n],keyword,value);
+          (void) SetImageProperty(attributes,keyword,value);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -7737,30 +8097,38 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
           (void) CopyMagickString(image_info->magick,value,MaxTextExtent);
           break;
         }
+      if (LocaleCompare(keyword,"mattecolor") == 0)
+        {
+          (void) QueryColorCompliance(value,AllCompliance,
+            &image_info->matte_color,exception);
+          break;
+        }
       ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
       break;
     }
     case 'P':
     case 'p':
     {
-      if (LocaleCompare(keyword,"mattecolor") == 0)
+      if (LocaleCompare(keyword,"pointsize") == 0)
         {
-          (void) QueryColorDatabase(value,&image_info->matte_color,
-            exception);
+          image_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
+          draw_info->pointsize=InterpretLocaleValue(value,(char **) NULL);
           break;
         }
       ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
       break;
     }
-    case 'P':
-    case 'p':
+    case 'Q':
+    case 'q':
     {
-      if (LocaleCompare(keyword,"pointsize") == 0)
+      if (LocaleCompare(keyword,"quality") == 0)
         {
-          draw_info->pointsize=atof(value);
+          image_info->quality=StringToLong(value);
+          if (image == (Image *) NULL)
+            break;
+          image->quality=StringToLong(value);
           break;
         }
-      ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
       break;
     }
     case 'S':
@@ -7773,7 +8141,9 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *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;
         }
       ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
@@ -7787,6 +8157,7 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword,
   }
   return(MagickTrue);
 }
+#endif
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -7828,7 +8199,8 @@ ModuleExport void UnregisterMSLImage(void)
 %
 %  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.
 %
@@ -7836,8 +8208,11 @@ ModuleExport void UnregisterMSLImage(void)
 %
 %    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);
@@ -7846,7 +8221,7 @@ static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image)
   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