]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 16 Sep 2009 01:01:10 +0000 (01:01 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 16 Sep 2009 01:01:10 +0000 (01:01 +0000)
coders/msl.c

index edf316a8ea8209a40eb6dfafd5394ff36b85adb4..7d151499ed25d85f1ca726a518174e41db29b767 100644 (file)
@@ -152,9 +152,13 @@ typedef struct _MSLInfo
 #if defined(MAGICKCORE_XML_DELEGATE)
 static MagickBooleanType
   WriteMSLImage(const ImageInfo *,Image *);
+
+static MagickBooleanType
+  SetMSLAttributes(MSLInfo *,const xmlChar **);
 #endif
 \f
 #if defined(MAGICKCORE_XML_DELEGATE)
+\f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -180,7 +184,6 @@ static MagickBooleanType
 %
 %    o exception: return any errors or warnings in this structure.
 %
-%
 */
 
 #if defined(__cplusplus) || defined(c_plusplus)
@@ -239,8 +242,8 @@ static void MSLInternalSubset(void *context,const xmlChar *name,
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
     "  SAX.internalSubset(%s %s %s)",name,
-    (external_id != (const xmlChar *) NULL ? (char *) external_id : " "),
-    (system_id != (const xmlChar *) NULL ? (char *) system_id : " "));
+    (external_id != (const xmlChar *) NULL ? (const char *) external_id : " "),
+    (system_id != (const xmlChar *) NULL ? (const char *) system_id : " "));
   msl_info=(MSLInfo *) context;
   (void) xmlCreateIntSubset(msl_info->document,name,external_id,system_id);
 }
@@ -262,8 +265,8 @@ static xmlParserInputPtr MSLResolveEntity(void *context,
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
     "  SAX.resolveEntity(%s, %s)",
-    (public_id != (const xmlChar *) NULL ? (char *) public_id : "none"),
-    (system_id != (const xmlChar *) NULL ? (char *) system_id : "none"));
+    (public_id != (const xmlChar *) NULL ? (const char *) public_id : "none"),
+    (system_id != (const xmlChar *) NULL ? (const char *) system_id : "none"));
   msl_info=(MSLInfo *) context;
   stream=xmlLoadExternalEntity((const char *) system_id,(const char *)
     public_id,msl_info->parser);
@@ -279,7 +282,7 @@ static xmlEntityPtr MSLGetEntity(void *context,const xmlChar *name)
     Get an entity by name.
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-    "  SAX.MSLGetEntity(%s)",(char *) name);
+    "  SAX.MSLGetEntity(%s)",(const char *) name);
   msl_info=(MSLInfo *) context;
   return(xmlGetDocEntity(msl_info->document,name));
 }
@@ -293,7 +296,7 @@ static xmlEntityPtr MSLGetParameterEntity(void *context,const xmlChar *name)
     Get a parameter entity by name.
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-    "  SAX.getParameterEntity(%s)",(char *) name);
+    "  SAX.getParameterEntity(%s)",(const char *) name);
   msl_info=(MSLInfo *) context;
   return(xmlGetParameterEntity(msl_info->document,name));
 }
@@ -309,8 +312,9 @@ static void MSLEntityDeclaration(void *context,const xmlChar *name,int type,
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
     "  SAX.entityDecl(%s, %d, %s, %s, %s)",name,type,
-    public_id != (const xmlChar *) NULL ? (char *) public_id : "none",
-    system_id != (const xmlChar *) NULL ? (char *) system_id : "none",content);
+    public_id != (const xmlChar *) NULL ? (const char *) public_id : "none",
+    system_id != (const xmlChar *) NULL ? (const char *) system_id : "none",
+    content);
   msl_info=(MSLInfo *) context;
   if (msl_info->parser->inSubset == 1)
     (void) xmlAddDocEntity(msl_info->document,name,type,public_id,system_id,
@@ -400,8 +404,8 @@ static void MSLNotationDeclaration(void *context,const xmlChar *name,
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
     "  SAX.notationDecl(%s, %s, %s)",name,
-    public_id != (const xmlChar *) NULL ? (char *) public_id : "none",
-    system_id != (const xmlChar *) NULL ? (char *) system_id : "none");
+    public_id != (const xmlChar *) NULL ? (const char *) public_id : "none",
+    system_id != (const xmlChar *) NULL ? (const char *) system_id : "none");
   msl_info=(MSLInfo *) context;
   parser=msl_info->parser;
   if (parser->inSubset == 1)
@@ -424,8 +428,9 @@ static void MSLUnparsedEntityDeclaration(void *context,const xmlChar *name,
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
     "  SAX.unparsedEntityDecl(%s, %s, %s, %s)",name,
-    public_id != (const xmlChar *) NULL ? (char *) public_id : "none",
-    system_id != (const xmlChar *) NULL ? (char *) system_id : "none",notation);
+    public_id != (const xmlChar *) NULL ? (const char *) public_id : "none",
+    system_id != (const xmlChar *) NULL ? (const char *) system_id : "none",
+    notation);
   msl_info=(MSLInfo *) context;
   (void) xmlAddDocEntity(msl_info->document,name,
     XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,public_id,system_id,notation);
@@ -608,7 +613,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'A':
     case 'a':
     {
-      if (LocaleCompare((char *) tag,"add-noise") == 0)
+      if (LocaleCompare((const char *) tag,"add-noise") == 0)
         {
           Image
             *noise_image;
@@ -621,7 +626,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           noise=UniformNoise;
@@ -630,7 +636,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -683,7 +689,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=noise_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"annotate") == 0)
+      if (LocaleCompare((const char *) tag,"annotate") == 0)
         {
           char
             text[MaxTextExtent];
@@ -693,7 +699,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           draw_info=CloneDrawInfo(msl_info->image_info[n],
@@ -706,7 +713,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1016,17 +1023,18 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
-      if (LocaleCompare((char *) tag,"append") == 0)
+      if (LocaleCompare((const char *) tag,"append") == 0)
         {
           Image
             *append_image;
 
           MagickBooleanType
             stack;
-   
+
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           stack=MagickFalse;
@@ -1035,7 +1043,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1078,7 +1086,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'B':
     case 'b':
     {
-      if (LocaleCompare((char *) tag,"blur") == 0)
+      if (LocaleCompare((const char *) tag,"blur") == 0)
         {
           Image
             *blur_image;
@@ -1088,7 +1096,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -1096,7 +1105,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1171,7 +1180,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=blur_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"border") == 0)
+      if (LocaleCompare((const char *) tag,"border") == 0)
         {
           Image
             *border_image;
@@ -1181,7 +1190,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           SetGeometry(msl_info->image[n],&geometry);
@@ -1190,7 +1200,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1284,7 +1294,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'C':
     case 'c':
     {
-      if (LocaleCompare((char *) tag,"colorize") == 0)
+      if (LocaleCompare((const char *) tag,"colorize") == 0)
         {
           char
             opacity[MaxTextExtent];
@@ -1300,7 +1310,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           target=msl_info->image[n]->background_color;
@@ -1310,7 +1321,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1355,14 +1366,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=colorize_image;
           break;
         }
-      if (LocaleCompare((char *) tag, "charcoal") == 0)
+      if (LocaleCompare((const char *) tag, "charcoal") == 0)
       {
         double  radius = 0.0,
             sigma = 1.0;
 
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
         /*
@@ -1374,7 +1386,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],(char *) attributes[i]));
+            msl_info->attributes[n],(const char *) attributes[i]));
           switch (*keyword)
           {
             case 'R':
@@ -1424,7 +1436,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         break;
         }
       }
-      if (LocaleCompare((char *) tag,"chop") == 0)
+      if (LocaleCompare((const char *) tag,"chop") == 0)
         {
           Image
             *chop_image;
@@ -1434,7 +1446,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           SetGeometry(msl_info->image[n],&geometry);
@@ -1443,7 +1456,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1526,7 +1539,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=chop_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"color-floodfill") == 0)
+      if (LocaleCompare((const char *) tag,"color-floodfill") == 0)
         {
           PaintMethod
             paint_method;
@@ -1539,7 +1552,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           draw_info=CloneDrawInfo(msl_info->image_info[n],
@@ -1551,7 +1565,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1645,9 +1659,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
-      if (LocaleCompare((char *) tag,"comment") == 0)
+      if (LocaleCompare((const char *) tag,"comment") == 0)
         break;
-      if (LocaleCompare((char *) tag,"composite") == 0)
+      if (LocaleCompare((const char *) tag,"composite") == 0)
         {
           char
             composite_geometry[MaxTextExtent];
@@ -1667,7 +1681,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           composite_image=NewImageList();
@@ -1677,7 +1692,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1704,7 +1719,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     {
                       const char
                         *attribute;
-    
+
                       attribute=GetImageProperty(msl_info->attributes[j],"id");
                       if ((attribute != (const char *) NULL)  &&
                           (LocaleCompare(attribute,value) == 0))
@@ -1729,7 +1744,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -1837,20 +1852,21 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                       long
                         opacity,
                         y;
-                    
+
                       register long
                         x;
-                    
+
                       register PixelPacket
                         *q;
-                    
+
                       CacheView
                         *composite_view;
 
                       opacity=QuantumRange-atol(value);
                       if (compose != DissolveCompositeOp)
                         {
-                          (void) SetImageOpacity(composite_image,(Quantum) opacity);
+                          (void) SetImageOpacity(composite_image,(Quantum)
+                            opacity);
                           break;
                         }
                       (void) SetImageArtifact(msl_info->image[n],
@@ -1859,11 +1875,11 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                         (void) SetImageOpacity(composite_image,OpaqueOpacity);
                       composite_view=AcquireCacheView(composite_image);
                       for (y=0; y < (long) 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++)
-                        { 
+                        {
                           if (q->opacity == OpaqueOpacity)
                             q->opacity=RoundToQuantum(opacity);
                           q++;
@@ -1992,7 +2008,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           composite_image=DestroyImage(composite_image);
           break;
         }
-      if (LocaleCompare((char *) tag,"contrast") == 0)
+      if (LocaleCompare((const char *) tag,"contrast") == 0)
         {
           MagickBooleanType
             sharpen;
@@ -2002,7 +2018,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           sharpen=MagickFalse;
@@ -2011,7 +2028,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2043,7 +2060,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) ContrastImage(msl_info->image[n],sharpen);
           break;
         }
-      if (LocaleCompare((char *) tag,"crop") == 0)
+      if (LocaleCompare((const char *) tag,"crop") == 0)
         {
           Image
             *crop_image;
@@ -2053,7 +2070,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           SetGeometry(msl_info->image[n],&geometry);
@@ -2062,7 +2080,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2145,7 +2163,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=crop_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"cycle-colormap") == 0)
+      if (LocaleCompare((const char *) tag,"cycle-colormap") == 0)
         {
           long
             display;
@@ -2155,7 +2173,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           display=0;
@@ -2164,7 +2183,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2196,7 +2215,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'D':
     case 'd':
     {
-      if (LocaleCompare((char *) tag,"despeckle") == 0)
+      if (LocaleCompare((const char *) tag,"despeckle") == 0)
         {
           Image
             *despeckle_image;
@@ -2206,7 +2225,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2214,7 +2234,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
             }
@@ -2226,11 +2246,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=despeckle_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"display") == 0)
+      if (LocaleCompare((const char *) tag,"display") == 0)
         {
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2238,7 +2259,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2253,7 +2274,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) DisplayImages(msl_info->image_info[n],msl_info->image[n]);
           break;
         }
-      if (LocaleCompare((char *) tag,"draw") == 0)
+      if (LocaleCompare((const char *) tag,"draw") == 0)
         {
           char
             text[MaxTextExtent];
@@ -2263,7 +2284,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           draw_info=CloneDrawInfo(msl_info->image_info[n],
@@ -2276,7 +2298,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2408,7 +2430,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                 case 'p':
                 {
                   if (LocaleCompare(keyword,"primitive") == 0)
-                    { 
+                    {
                       CloneString(&draw_info->primitive,value);
                       break;
                     }
@@ -2594,7 +2616,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'E':
     case 'e':
     {
-      if (LocaleCompare((char *) tag,"edge") == 0)
+      if (LocaleCompare((const char *) tag,"edge") == 0)
         {
           Image
             *edge_image;
@@ -2604,7 +2626,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2612,7 +2635,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2658,7 +2681,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=edge_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"emboss") == 0)
+      if (LocaleCompare((const char *) tag,"emboss") == 0)
         {
           Image
             *emboss_image;
@@ -2668,7 +2691,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2676,7 +2700,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2734,7 +2758,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=emboss_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"enhance") == 0)
+      if (LocaleCompare((const char *) tag,"enhance") == 0)
         {
           Image
             *enhance_image;
@@ -2744,7 +2768,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2752,7 +2777,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
             }
@@ -2764,14 +2789,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=enhance_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"equalize") == 0)
+      if (LocaleCompare((const char *) tag,"equalize") == 0)
         {
           /*
             Equalize image.
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2779,7 +2805,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -2799,11 +2825,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'F':
     case 'f':
     {
-      if (LocaleCompare((char *) tag, "flatten") == 0)
+      if (LocaleCompare((const char *) tag, "flatten") == 0)
       {
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
 
@@ -2823,7 +2850,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           break;
         }
       }
-      if (LocaleCompare((char *) tag,"flip") == 0)
+      if (LocaleCompare((const char *) tag,"flip") == 0)
         {
           Image
             *flip_image;
@@ -2833,7 +2860,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2841,7 +2869,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
             }
@@ -2853,7 +2881,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=flip_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"flop") == 0)
+      if (LocaleCompare((const char *) tag,"flop") == 0)
         {
           Image
             *flop_image;
@@ -2863,7 +2891,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -2871,7 +2900,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
             }
@@ -2883,7 +2912,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=flop_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"frame") == 0)
+      if (LocaleCompare((const char *) tag,"frame") == 0)
         {
           FrameInfo
             frame_info;
@@ -2896,7 +2925,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           SetGeometry(msl_info->image[n],&geometry);
@@ -2905,7 +2935,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3031,7 +3061,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'G':
     case 'g':
     {
-      if (LocaleCompare((char *) tag,"gamma") == 0)
+      if (LocaleCompare((const char *) tag,"gamma") == 0)
         {
           char
             gamma[MaxTextExtent];
@@ -3044,7 +3074,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           channel=UndefinedChannel;
@@ -3057,7 +3088,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3129,7 +3160,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           if (*gamma == '\0')
             (void) FormatMagickString(gamma,MaxTextExtent,"%g,%g,%g",
               (double) pixel.red,(double) pixel.green,(double) pixel.blue);
-          switch (channel)          
+          switch (channel)
           {
             default:
             {
@@ -3156,11 +3187,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           }
           break;
         }
-      else if (LocaleCompare((char *) tag,"get") == 0)
+      else if (LocaleCompare((const char *) tag,"get") == 0)
         {
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes == (const xmlChar **) NULL)
@@ -3168,7 +3200,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
           {
             keyword=(const char *) attributes[i++];
-            CloneString(&value,(char *) attributes[i]);
+            CloneString(&value,(const char *) attributes[i]);
             (void) CopyMagickString(key,value,MaxTextExtent);
             switch (*keyword)
             {
@@ -3205,7 +3237,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           }
           break;
         }
-    else if (LocaleCompare((char *) tag, "group") == 0)
+    else if (LocaleCompare((const char *) tag, "group") == 0)
     {
       msl_info->number_groups++;
       msl_info->group_info=(MSLGroupInfo *) ResizeQuantumMemory(
@@ -3218,92 +3250,56 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'I':
     case 'i':
     {
-      if (LocaleCompare((char *) tag,"image") == 0)
+      if (LocaleCompare((const char *) tag,"image") == 0)
         {
           long
             n;
 
           MSLPushImage(msl_info,(Image *) NULL);
-          n=msl_info->n;
           if (attributes == (const xmlChar **) NULL)
             break;
+          (void) SetMSLAttributes(msl_info,attributes);
           for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
           {
             keyword=(const char *) attributes[i++];
             CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
-              msl_info->attributes[n],(char *) attributes[i]));
+              msl_info->attributes[n],(const char *) attributes[i]));
             switch (*keyword)
             {
-      case 'B':
-      case 'b':
-        {
-          if (LocaleCompare(keyword,"background") == 0)
-          {
-            (void) QueryColorDatabase(value,
-              &msl_info->image_info[n]->background_color,&exception);
-            break;
-          }
-          ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-          break;
-        }
-
-      case 'C':
-      case 'c':
-        {
-          if (LocaleCompare(keyword,"color") == 0)
-          {
-            Image
-              *next_image;
-
-            (void) CopyMagickString(msl_info->image_info[n]->filename,"xc:",
-              MaxTextExtent);
-            (void) ConcatenateMagickString(msl_info->image_info[n]->filename,
-              value,MaxTextExtent);
-            next_image=ReadImage(msl_info->image_info[n],&exception);
-            CatchException(&exception);
-            if (next_image == (Image *) NULL)
-              continue;
-            if (msl_info->image[n] == (Image *) NULL)
-              msl_info->image[n]=next_image;
-            else
+              case 'C':
+              case 'c':
               {
-              register Image
-                *p;
-
-              /*
-                Link image into image list.
-              */
-              p=msl_info->image[n];
-              for ( ; p->next != (Image *) NULL; p=GetNextImageInList(p)) ;
-              next_image->previous=p;
-              p->next=next_image;
-              }
-            break;
-          }
-          ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-          break;
-        }
+                if (LocaleCompare(keyword,"color") == 0)
+                  {
+                    Image
+                      *next_image;
 
-      case 'I':
-      case 'i':
-        {
-          if (LocaleCompare(keyword,"id") == 0)
-          {
-            (void) SetImageProperty(msl_info->attributes[n],keyword,NULL);  /* make sure to clear it! */
-            (void) SetImageProperty(msl_info->attributes[n],keyword,value);
-            break;
-          }
-          ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
-          break;
-        }
-              case 'S':
-              case 's':
-              {
-                if (LocaleCompare(keyword,"size") == 0)
-                {
-          CloneString(&msl_info->image_info[n]->size,value);
-          break;
-        }
+                    (void) CopyMagickString(msl_info->image_info[n]->filename,
+                      "xc:",MaxTextExtent);
+                    (void) ConcatenateMagickString(msl_info->image_info[n]->
+                      filename,value,MaxTextExtent);
+                    next_image=ReadImage(msl_info->image_info[n],&exception);
+                    CatchException(&exception);
+                    if (next_image == (Image *) NULL)
+                      continue;
+                    if (msl_info->image[n] == (Image *) NULL)
+                      msl_info->image[n]=next_image;
+                    else
+                      {
+                        register Image
+                          *p;
+
+                        /*
+                          Link image into image list.
+                        */
+                        p=msl_info->image[n];
+                        while (p->next != (Image *) NULL)
+                          p=GetNextImageInList(p);
+                        next_image->previous=p;
+                        p->next=next_image;
+                      }
+                    break;
+                  }
                 ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
                 break;
               }
@@ -3316,7 +3312,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           }
           break;
         }
-      if (LocaleCompare((char *) tag,"implode") == 0)
+      if (LocaleCompare((const char *) tag,"implode") == 0)
         {
           Image
             *implode_image;
@@ -3326,7 +3322,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -3334,7 +3331,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3385,16 +3382,17 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'L':
     case 'l':
     {
-      if (LocaleCompare((char *) tag,"label") == 0)
+      if (LocaleCompare((const char *) tag,"label") == 0)
         break;
-      if (LocaleCompare((char *) tag, "level") == 0)
+      if (LocaleCompare((const char *) tag, "level") == 0)
       {
         double
           levelBlack = 0, levelGamma = 1, levelWhite = QuantumRange;
 
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
         if (attributes == (const xmlChar **) NULL)
@@ -3402,7 +3400,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
         {
           keyword=(const char *) attributes[i++];
-          CloneString(&value,(char *) attributes[i]);
+          CloneString(&value,(const char *) attributes[i]);
           (void) CopyMagickString(key,value,MaxTextExtent);
           switch (*keyword)
           {
@@ -3460,7 +3458,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'M':
     case 'm':
     {
-      if (LocaleCompare((char *) tag,"magnify") == 0)
+      if (LocaleCompare((const char *) tag,"magnify") == 0)
         {
           Image
             *magnify_image;
@@ -3470,7 +3468,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -3478,7 +3477,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
             }
@@ -3490,7 +3489,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=magnify_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"map") == 0)
+      if (LocaleCompare((const char *) tag,"map") == 0)
         {
           Image
             *affinity_image;
@@ -3506,7 +3505,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           affinity_image=NewImageList();
@@ -3516,7 +3516,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3545,7 +3545,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     {
                       const char
                         *attribute;
-    
+
                       attribute=GetImageProperty(msl_info->attributes[j],"id");
                       if ((attribute != (const char *) NULL)  &&
                           (LocaleCompare(attribute,value) == 0))
@@ -3573,7 +3573,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           affinity_image=DestroyImage(affinity_image);
           break;
         }
-      if (LocaleCompare((char *) tag,"matte-floodfill") == 0)
+      if (LocaleCompare((const char *) tag,"matte-floodfill") == 0)
         {
           double
             opacity;
@@ -3590,7 +3590,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           opacity=0.0;
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           SetGeometry(msl_info->image[n],&geometry);
@@ -3600,7 +3601,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3703,7 +3704,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
-      if (LocaleCompare((char *) tag,"median-filter") == 0)
+      if (LocaleCompare((const char *) tag,"median-filter") == 0)
         {
           Image
             *median_image;
@@ -3713,7 +3714,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -3721,7 +3723,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3767,7 +3769,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=median_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"minify") == 0)
+      if (LocaleCompare((const char *) tag,"minify") == 0)
         {
           Image
             *minify_image;
@@ -3777,7 +3779,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -3785,7 +3788,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
             }
@@ -3797,9 +3800,9 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=minify_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"msl") == 0 )
+      if (LocaleCompare((const char *) tag,"msl") == 0 )
         break;
-      if (LocaleCompare((char *) tag,"modulate") == 0)
+      if (LocaleCompare((const char *) tag,"modulate") == 0)
         {
           char
             modulate[MaxTextExtent];
@@ -3809,7 +3812,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           geometry_info.rho=100.0;
@@ -3820,7 +3824,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3919,7 +3923,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'N':
     case 'n':
     {
-      if (LocaleCompare((char *) tag,"negate") == 0)
+      if (LocaleCompare((const char *) tag,"negate") == 0)
         {
           MagickBooleanType
             gray;
@@ -3929,7 +3933,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           gray=MagickFalse;
@@ -3938,7 +3943,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -3986,14 +3991,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) NegateImageChannel(msl_info->image[n],channel,gray);
           break;
         }
-      if (LocaleCompare((char *) tag,"normalize") == 0)
+      if (LocaleCompare((const char *) tag,"normalize") == 0)
         {
           /*
             Normalize image.
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -4001,7 +4007,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4037,7 +4043,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'O':
     case 'o':
     {
-      if (LocaleCompare((char *) tag,"oil-paint") == 0)
+      if (LocaleCompare((const char *) tag,"oil-paint") == 0)
         {
           Image
             *paint_image;
@@ -4047,7 +4053,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -4055,7 +4062,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4101,7 +4108,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=paint_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"opaque") == 0)
+      if (LocaleCompare((const char *) tag,"opaque") == 0)
         {
           MagickPixelPacket
             fill_color,
@@ -4112,7 +4119,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           (void) QueryMagickColor("none",&target,&exception);
@@ -4122,7 +4130,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4176,7 +4184,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'P':
     case 'p':
     {
-      if (LocaleCompare((char *) tag,"print") == 0)
+      if (LocaleCompare((const char *) tag,"print") == 0)
         {
           if (attributes == (const xmlChar **) NULL)
             break;
@@ -4184,7 +4192,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           {
             keyword=(const char *) attributes[i++];
             attribute=InterpretImageProperties(msl_info->image_info[n],
-              msl_info->attributes[n],(char *) attributes[i]);
+              msl_info->attributes[n],(const char *) attributes[i]);
             CloneString(&value,attribute);
             switch (*keyword)
             {
@@ -4213,7 +4221,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'Q':
     case 'q':
     {
-      if (LocaleCompare((char *) tag,"quantize") == 0)
+      if (LocaleCompare((const char *) tag,"quantize") == 0)
         {
           QuantizeInfo
             quantize_info;
@@ -4223,7 +4231,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           GetQuantizeInfo(&quantize_info);
@@ -4232,7 +4241,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4315,7 +4324,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) QuantizeImage(&quantize_info,msl_info->image[n]);
           break;
         }
-      if (LocaleCompare((char *) tag,"query-font-metrics") == 0)
+      if (LocaleCompare((const char *) tag,"query-font-metrics") == 0)
         {
           char
             text[MaxTextExtent];
@@ -4339,7 +4348,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4685,7 +4694,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'R':
     case 'r':
     {
-      if (LocaleCompare((char *) tag,"raise") == 0)
+      if (LocaleCompare((const char *) tag,"raise") == 0)
         {
           MagickBooleanType
             raise;
@@ -4695,7 +4704,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           raise=MagickFalse;
@@ -4705,7 +4715,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4776,7 +4786,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) RaiseImage(msl_info->image[n],&geometry,raise);
           break;
         }
-      if (LocaleCompare((char *) tag,"read") == 0)
+      if (LocaleCompare((const char *) tag,"read") == 0)
         {
           if (attributes == (const xmlChar **) NULL)
             break;
@@ -4784,7 +4794,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],(char *) attributes[i]));
+              msl_info->attributes[n],(const char *) attributes[i]));
             switch (*keyword)
             {
               case 'F':
@@ -4855,7 +4865,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           }
           break;
         }
-      if (LocaleCompare((char *) tag,"reduce-noise") == 0)
+      if (LocaleCompare((const char *) tag,"reduce-noise") == 0)
         {
           Image
             *paint_image;
@@ -4865,7 +4875,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -4873,7 +4884,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -4919,7 +4930,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=paint_image;
           break;
         }
-      else if (LocaleCompare((char *) tag,"repage") == 0)
+      else if (LocaleCompare((const char *) tag,"repage") == 0)
       {
         /* init the values */
         width=msl_info->image[n]->page.width;
@@ -4929,7 +4940,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
         if (attributes == (const xmlChar **) NULL)
@@ -4938,7 +4950,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],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'G':
@@ -5039,13 +5051,13 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
         }
 
-         msl_info->image[n]->page.width=width;        
-         msl_info->image[n]->page.height=height;        
-         msl_info->image[n]->page.x=x;        
-         msl_info->image[n]->page.y=y;        
+         msl_info->image[n]->page.width=width;
+         msl_info->image[n]->page.height=height;
+         msl_info->image[n]->page.x=x;
+         msl_info->image[n]->page.y=y;
         break;
       }
-    else if (LocaleCompare((char *) tag,"resample") == 0)
+    else if (LocaleCompare((const char *) tag,"resample") == 0)
     {
       double
         x_resolution,
@@ -5053,7 +5065,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
       if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
       if (attributes == (const xmlChar **) NULL)
@@ -5064,7 +5077,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],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'b':
@@ -5153,7 +5166,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
       }
       break;
     }
-      if (LocaleCompare((char *) tag,"resize") == 0)
+      if (LocaleCompare((const char *) tag,"resize") == 0)
         {
           double
             blur;
@@ -5169,7 +5182,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           filter=UndefinedFilter;
@@ -5179,7 +5193,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -5265,7 +5279,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=resize_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"roll") == 0)
+      if (LocaleCompare((const char *) tag,"roll") == 0)
         {
           Image
             *roll_image;
@@ -5275,7 +5289,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           SetGeometry(msl_info->image[n],&geometry);
@@ -5284,7 +5299,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -5343,7 +5358,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=roll_image;
           break;
         }
-      else if (LocaleCompare((char *) tag,"roll") == 0)
+      else if (LocaleCompare((const char *) tag,"roll") == 0)
       {
         /* init the values */
         width=msl_info->image[n]->columns;
@@ -5352,7 +5367,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
         if (attributes == (const xmlChar **) NULL)
@@ -5361,7 +5377,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],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'G':
@@ -5421,7 +5437,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
         break;
       }
-      if (LocaleCompare((char *) tag,"rotate") == 0)
+      if (LocaleCompare((const char *) tag,"rotate") == 0)
         {
           Image
             *rotate_image;
@@ -5431,7 +5447,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -5439,7 +5456,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -5485,14 +5502,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=rotate_image;
           break;
         }
-      else if (LocaleCompare((char *) tag,"rotate") == 0)
+      else if (LocaleCompare((const char *) tag,"rotate") == 0)
       {
         /* init the values */
         double  degrees = 0;
 
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
         if (attributes == (const xmlChar **) NULL)
@@ -5501,7 +5519,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],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'D':
@@ -5544,7 +5562,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'S':
     case 's':
     {
-      if (LocaleCompare((char *) tag,"sample") == 0)
+      if (LocaleCompare((const char *) tag,"sample") == 0)
         {
           Image
             *sample_image;
@@ -5554,7 +5572,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -5562,7 +5581,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -5619,7 +5638,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=sample_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"scale") == 0)
+      if (LocaleCompare((const char *) tag,"scale") == 0)
         {
           Image
             *scale_image;
@@ -5629,7 +5648,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -5637,7 +5657,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -5694,20 +5714,21 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=scale_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"segment") == 0)
+      if (LocaleCompare((const char *) tag,"segment") == 0)
         {
           ColorspaceType
             colorspace;
 
           MagickBooleanType
             verbose;
-            
+
           /*
             Segment image.
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           geometry_info.rho=1.0;
@@ -5719,7 +5740,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -5783,11 +5804,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             geometry_info.rho,geometry_info.sigma);
           break;
         }
-      else if (LocaleCompare((char *) tag, "set") == 0)
+      else if (LocaleCompare((const char *) tag, "set") == 0)
       {
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
 
@@ -5797,7 +5819,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],(char *) attributes[i]));
+            msl_info->attributes[n],(const char *) attributes[i]));
           switch (*keyword)
           {
             case 'B':
@@ -5976,7 +5998,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
         break;
       }
-      if (LocaleCompare((char *) tag,"shade") == 0)
+      if (LocaleCompare((const char *) tag,"shade") == 0)
         {
           Image
             *shade_image;
@@ -5989,7 +6011,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           gray=MagickFalse;
@@ -5998,7 +6021,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6066,7 +6089,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=shade_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"shadow") == 0)
+      if (LocaleCompare((const char *) tag,"shadow") == 0)
         {
           Image
             *shadow_image;
@@ -6076,7 +6099,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -6084,7 +6108,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6165,16 +6189,17 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=shadow_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"sharpen") == 0)
+      if (LocaleCompare((const char *) tag,"sharpen") == 0)
       {
         double  radius = 0.0,
             sigma = 1.0;
 
         if (msl_info->image[n] == (Image *) NULL)
-        {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
-          break;
-        }
+          {
+            ThrowMSLException(OptionError,"NoImagesDefined",
+              (const char *) tag);
+            break;
+          }
         /*
         NOTE: sharpen can have no attributes, since we use all the defaults!
         */
@@ -6184,7 +6209,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],(char *) attributes[i]));
+            msl_info->attributes[n],(const char *) attributes[i]));
           switch (*keyword)
           {
             case 'R':
@@ -6233,7 +6258,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         break;
         }
       }
-      else if (LocaleCompare((char *) tag,"shave") == 0)
+      else if (LocaleCompare((const char *) tag,"shave") == 0)
       {
         /* init the values */
         width = height = 0;
@@ -6241,7 +6266,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
         if (msl_info->image[n] == (Image *) NULL)
         {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+          ThrowMSLException(OptionError,"NoImagesDefined",
+            (const char *) tag);
           break;
         }
         if (attributes == (const xmlChar **) NULL)
@@ -6250,7 +6276,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],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'G':
@@ -6319,7 +6345,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
         break;
       }
-      if (LocaleCompare((char *) tag,"shear") == 0)
+      if (LocaleCompare((const char *) tag,"shear") == 0)
         {
           Image
             *shear_image;
@@ -6329,7 +6355,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -6337,7 +6364,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6408,14 +6435,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=shear_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"signature") == 0)
+      if (LocaleCompare((const char *) tag,"signature") == 0)
         {
           /*
             Signature image.
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -6423,7 +6451,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6438,14 +6466,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) SignatureImage(msl_info->image[n]);
           break;
         }
-      if (LocaleCompare((char *) tag,"solarize") == 0)
+      if (LocaleCompare((const char *) tag,"solarize") == 0)
         {
           /*
             Solarize image.
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           geometry_info.rho=QuantumRange/2.0;
@@ -6454,7 +6483,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6493,7 +6522,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           (void) SolarizeImage(msl_info->image[n],geometry_info.rho);
           break;
         }
-      if (LocaleCompare((char *) tag,"spread") == 0)
+      if (LocaleCompare((const char *) tag,"spread") == 0)
         {
           Image
             *spread_image;
@@ -6503,7 +6532,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -6511,7 +6541,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6557,23 +6587,24 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=spread_image;
           break;
         }
-      else if (LocaleCompare((char *) tag,"stegano") == 0)
+      else if (LocaleCompare((const char *) tag,"stegano") == 0)
       {
         Image *
           watermark = (Image*)NULL;
 
         if (msl_info->image[n] == (Image *) NULL)
-        {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
-          break;
-        }
+          {
+            ThrowMSLException(OptionError,"NoImagesDefined",
+              (const char *) tag);
+            break;
+          }
         if (attributes == (const xmlChar **) NULL)
         break;
         for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
         {
         keyword=(const char *) attributes[i++];
         CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
-          msl_info->attributes[n],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'I':
@@ -6621,23 +6652,23 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         } else
           ThrowMSLException(OptionError,"MissingWatermarkImage",keyword);
       }
-      else if (LocaleCompare((char *) tag,"stereo") == 0)
+      else if (LocaleCompare((const char *) tag,"stereo") == 0)
       {
         Image *
           stereoImage = (Image*)NULL;
 
         if (msl_info->image[n] == (Image *) NULL)
-        {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
-          break;
-        }
+          {
+            ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+            break;
+          }
         if (attributes == (const xmlChar **) NULL)
         break;
         for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
         {
         keyword=(const char *) attributes[i++];
         CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
-          msl_info->attributes[n],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'I':
@@ -6685,7 +6716,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         } else
           ThrowMSLException(OptionError,"Missing stereo image",keyword);
       }
-      if (LocaleCompare((char *) tag,"swap") == 0)
+      if (LocaleCompare((const char *) tag,"swap") == 0)
         {
           Image
             *p,
@@ -6698,7 +6729,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
 
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           index=(-1);
@@ -6708,7 +6740,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6742,7 +6774,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           q=GetImageFromList(msl_info->image[n],swap_index);
           if ((p == (Image *) NULL) || (q == (Image *) NULL))
             {
-              ThrowMSLException(OptionError,"NoSuchImage",(char *) tag);
+              ThrowMSLException(OptionError,"NoSuchImage",(const char *) tag);
               break;
             }
           swap=CloneImage(p,0,0,MagickTrue,&p->exception);
@@ -6751,7 +6783,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=GetFirstImageInList(q);
           break;
         }
-      if (LocaleCompare((char *) tag,"swirl") == 0)
+      if (LocaleCompare((const char *) tag,"swirl") == 0)
         {
           Image
             *swirl_image;
@@ -6761,7 +6793,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -6769,7 +6802,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6815,14 +6848,15 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           msl_info->image[n]=swirl_image;
           break;
         }
-      if (LocaleCompare((char *) tag,"sync") == 0)
+      if (LocaleCompare((const char *) tag,"sync") == 0)
         {
           /*
             Sync image.
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes != (const xmlChar **) NULL)
@@ -6830,7 +6864,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6850,7 +6884,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'T':
     case 't':
     {
-      if (LocaleCompare((char *) tag,"map") == 0)
+      if (LocaleCompare((const char *) tag,"map") == 0)
         {
           Image
             *texture_image;
@@ -6860,7 +6894,8 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           */
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           texture_image=NewImageList();
@@ -6869,7 +6904,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
             {
               keyword=(const char *) attributes[i++];
               attribute=InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]);
+                msl_info->attributes[n],(const char *) attributes[i]);
               CloneString(&value,attribute);
               switch (*keyword)
               {
@@ -6881,7 +6916,7 @@ static void MSLStartElement(void *context,const xmlChar *tag,
                     {
                       const char
                         *attribute;
-    
+
                       attribute=GetImageProperty(msl_info->attributes[j],"id");
                       if ((attribute != (const char *) NULL)  &&
                           (LocaleCompare(attribute,value) == 0))
@@ -6905,23 +6940,23 @@ static void MSLStartElement(void *context,const xmlChar *tag,
           texture_image=DestroyImage(texture_image);
           break;
         }
-      else if (LocaleCompare((char *) tag,"threshold") == 0)
+      else if (LocaleCompare((const char *) tag,"threshold") == 0)
       {
         /* init the values */
         double  threshold = 0;
 
         if (msl_info->image[n] == (Image *) NULL)
-        {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
-          break;
-        }
+          {
+            ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+            break;
+          }
         if (attributes == (const xmlChar **) NULL)
         break;
         for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
         {
         keyword=(const char *) attributes[i++];
         CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
-          msl_info->attributes[n],(char *) attributes[i]));
+          msl_info->attributes[n],(const char *) attributes[i]));
         switch (*keyword)
         {
           case 'T':
@@ -6953,20 +6988,20 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         break;
         }
       }
-      else if (LocaleCompare((char *) tag, "transparent") == 0)
+      else if (LocaleCompare((const char *) tag, "transparent") == 0)
       {
         if (msl_info->image[n] == (Image *) NULL)
-        {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
-          break;
-        }
+          {
+            ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+            break;
+          }
         if (attributes == (const xmlChar **) NULL)
           break;
         for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
         {
           keyword=(const char *) attributes[i++];
           CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
-                msl_info->attributes[n],(char *) attributes[i]));
+            msl_info->attributes[n],(const char *) attributes[i]));
           switch (*keyword)
           {
             case 'C':
@@ -6994,13 +7029,13 @@ static void MSLStartElement(void *context,const xmlChar *tag,
         }
         break;
       }
-      else if (LocaleCompare((char *) tag, "trim") == 0)
+      else if (LocaleCompare((const char *) tag, "trim") == 0)
       {
         if (msl_info->image[n] == (Image *) NULL)
-        {
-          ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
-          break;
-        }
+          {
+            ThrowMSLException(OptionError,"NoImagesDefined",(const char *) tag);
+            break;
+          }
 
         /* no attributes here */
 
@@ -7028,11 +7063,12 @@ static void MSLStartElement(void *context,const xmlChar *tag,
     case 'W':
     case 'w':
     {
-      if (LocaleCompare((char *) tag,"write") == 0)
+      if (LocaleCompare((const char *) tag,"write") == 0)
         {
           if (msl_info->image[n] == (Image *) NULL)
             {
-              ThrowMSLException(OptionError,"NoImagesDefined",(char *) tag);
+              ThrowMSLException(OptionError,"NoImagesDefined",
+                (const char *) tag);
               break;
             }
           if (attributes == (const xmlChar **) NULL)
@@ -7041,7 +7077,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],(char *) attributes[i]));
+              msl_info->attributes[n],(const char *) attributes[i]));
             switch (*keyword)
             {
               case 'F':
@@ -7114,7 +7150,7 @@ static void MSLEndElement(void *context,const xmlChar *tag)
     case 'C':
     case 'c':
     {
-      if (LocaleCompare((char *) tag,"comment") == 0 )
+      if (LocaleCompare((const char *) tag,"comment") == 0 )
         {
           (void) DeleteImageProperty(msl_info->image[n],"comment");
           if (msl_info->content == (char *) NULL)
@@ -7129,7 +7165,7 @@ static void MSLEndElement(void *context,const xmlChar *tag)
     case 'G':
     case 'g':
     {
-      if (LocaleCompare((char *) tag, "group") == 0 )
+      if (LocaleCompare((const char *) tag, "group") == 0 )
       {
         if (msl_info->group_info[msl_info->number_groups-1].numImages > 0 )
         {
@@ -7151,14 +7187,14 @@ static void MSLEndElement(void *context,const xmlChar *tag)
     case 'I':
     case 'i':
     {
-      if (LocaleCompare((char *) tag, "image") == 0)
+      if (LocaleCompare((const char *) tag, "image") == 0)
         MSLPopImage(msl_info);
        break;
     }
     case 'L':
     case 'l':
     {
-      if (LocaleCompare((char *) tag,"label") == 0 )
+      if (LocaleCompare((const char *) tag,"label") == 0 )
         {
           (void) DeleteImageProperty(msl_info->image[n],"label");
           if (msl_info->content == (char *) NULL)
@@ -7173,7 +7209,7 @@ static void MSLEndElement(void *context,const xmlChar *tag)
     case 'M':
     case 'm':
     {
-      if (LocaleCompare((char *) tag, "msl") == 0 )
+      if (LocaleCompare((const char *) tag, "msl") == 0 )
       {
         /*
           This our base element.
@@ -7396,8 +7432,8 @@ static void MSLExternalSubset(void *context,const xmlChar *name,
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
     "  SAX.externalSubset(%s %s %s)",name,
-    (external_id != (const xmlChar *) NULL ? (char *) external_id : " "),
-    (system_id != (const xmlChar *) NULL ? (char *) system_id : " "));
+    (external_id != (const xmlChar *) NULL ? (const char *) external_id : " "),
+    (system_id != (const xmlChar *) NULL ? (const char *) system_id : " "));
   msl_info=(MSLInfo *) context;
   parser=msl_info->parser;
   if (((external_id == NULL) && (system_id == NULL)) ||
@@ -7640,6 +7676,116 @@ ModuleExport unsigned long RegisterMSLImage(void)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   S e t M S L A t t r i b u t e s                                           %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  SetMSLAttributes() ...
+%
+%  The format of the SetMSLAttributes method is:
+%
+%      MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,
+%        const xmlChar **attributes)
+%
+%  A description of each parameter follows:
+%
+%    o msl_info: the MSL info.
+%
+%    o attributes: the attribute list.
+%
+*/
+static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,
+  const xmlChar **attributes)
+{
+  char
+    *value;
+
+  const char
+    *keyword;
+
+  ExceptionInfo
+    *exception;
+
+  long
+    n;
+
+  register long
+    i;
+
+  assert(msl_info != (MSLInfo *) NULL);
+  assert(exception != (ExceptionInfo *) NULL);
+  if (attributes == (const xmlChar **) NULL)
+    return(MagickTrue);
+  exception=msl_info->exception;
+  n=msl_info->n;
+  for (i=0; (attributes[i] != (const xmlChar *) NULL); i++)
+  {
+    keyword=(const char *) attributes[i++];
+    CloneString(&value,InterpretImageProperties(msl_info->image_info[n],
+      msl_info->attributes[n],(const char *) attributes[i]));
+    switch (*keyword)
+    {
+      case 'B':
+      case 'b':
+      {
+        if (LocaleCompare(keyword,"background") == 0)
+          {
+            (void) QueryColorDatabase(value,
+              &msl_info->image_info[n]->background_color,exception);
+            break;
+          }
+        ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+        break;
+      }
+      case 'F':
+      case 'f':
+      {
+        if (LocaleCompare(keyword,"fill") == 0)
+          {
+            (void) QueryColorDatabase(value,&msl_info->draw_info[n]->fill,
+              exception);
+            break;
+          }
+        ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+        break;
+      }
+      case 'I':
+      case 'i':
+      {
+        if (LocaleCompare(keyword,"id") == 0)
+          {
+            (void) SetImageProperty(msl_info->attributes[n],keyword,NULL);
+            (void) SetImageProperty(msl_info->attributes[n],keyword,value);
+            break;
+          }
+        ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+        break;
+      }
+      case 'S':
+      case 's':
+      {
+        if (LocaleCompare(keyword,"size") == 0)
+          {
+            CloneString(&msl_info->image_info[n]->size,value);
+            break;
+          }
+        ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword);
+        break;
+      }
+      default:
+        break;
+    }
+  }
+  return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   U n r e g i s t e r M S L I m a g e                                       %
 %                                                                             %
 %                                                                             %