]> granicus.if.org Git - imagemagick/blobdiff - magick/property.c
(no commit message)
[imagemagick] / magick / property.c
index a6a6c9654dfabb50288bb206a80e6d482e00e6db..60acd764164dbf46efddbbdc5f89287a0484f467 100644 (file)
@@ -17,7 +17,7 @@
 %                                 March 2000                                  %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -75,6 +75,7 @@
 #include "magick/string-private.h"
 #include "magick/token.h"
 #include "magick/utility.h"
+#include "magick/version.h"
 #include "magick/xml-tree.h"
 \f
 /*
@@ -303,7 +304,7 @@ MagickExport void DestroyImageProperties(Image *image)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  FormatImageProperty() permits formatted property/value pairs to be saved as
-%  an image proporty.
+%  an image property.
 %
 %  The format of the FormatImageProperty method is:
 %
@@ -320,39 +321,23 @@ MagickExport void DestroyImageProperties(Image *image)
 %      arguments.
 %
 */
-
-MagickExport MagickBooleanType FormatImagePropertyList(Image *image,
-  const char *property,const char *format,va_list operands)
+MagickExport MagickBooleanType FormatImageProperty(Image *image,
+  const char *property,const char *format,...)
 {
   char
     value[MaxTextExtent];
 
-  int
+  ssize_t
     n;
 
-#if defined(MAGICKCORE_HAVE_VSNPRINTF)
-  n=vsnprintf(value,MaxTextExtent,format,operands);
-#else
-  n=vsprintf(value,format,operands);
-#endif
-  if (n < 0)
-    value[MaxTextExtent-1]='\0';
-  return(SetImageProperty(image,property,value));
-}
-
-MagickExport MagickBooleanType FormatImageProperty(Image *image,
-  const char *property,const char *format,...)
-{
-  MagickBooleanType
-    status;
-
   va_list
     operands;
 
   va_start(operands,format);
-  status=FormatImagePropertyList(image,property,format,operands);
+  n=FormatLocaleStringList(value,MaxTextExtent,format,operands);
+  (void) n;
   va_end(operands);
-  return(status);
+  return(SetImageProperty(image,property,value));
 }
 \f
 /*
@@ -561,7 +546,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
     length;
 
   /*
-    There's no newlines in path names, so it's safe as terminator.
+    There are no newlines in path names, so it's safe as terminator.
   */
   profile=GetImageProfile(image,"8bim");
   if (profile == (StringInfo *) NULL)
@@ -603,7 +588,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
     if ((count != 0) && ((size_t) count <= length))
       {
         resource=(char *) NULL;
-        if (~(1UL*count) >= MaxTextExtent)
+        if (~(1UL*count) >= (MaxTextExtent-1))
           resource=(char *) AcquireQuantumMemory((size_t) count+MaxTextExtent,
             sizeof(*resource));
         if (resource != (char *) NULL)
@@ -615,7 +600,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
       }
     if ((count & 0x01) == 0)
       (void) ReadPropertyByte(&info,&length);
-    count=(int) ReadPropertyMSBLong(&info,&length);
+    count=(ssize_t) ((int) ReadPropertyMSBLong(&info,&length));
     if ((*name != '\0') && (*name != '#'))
       if ((resource == (char *) NULL) || (LocaleCompare(name,resource) != 0))
         {
@@ -640,7 +625,7 @@ static MagickBooleanType Get8BIMProperty(const Image *image,const char *key)
       We have the resource of interest.
     */
     attribute=(char *) NULL;
-    if (~(1UL*count) >= MaxTextExtent)
+    if (~(1UL*count) >= (MaxTextExtent-1))
       attribute=(char *) AcquireQuantumMemory((size_t) count+MaxTextExtent,
         sizeof(*attribute));
     if (attribute != (char *) NULL)
@@ -745,9 +730,9 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
    p1=p; \
    for (component=0; component < components; component++) \
    { \
-     length+=FormatMagickString(buffer+length,MaxTextExtent-length, \
+     length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
        format", ",arg); \
-     if (length >= MaxTextExtent - 1) \
+     if (length >= (MaxTextExtent-1)) \
        length=MaxTextExtent-1; \
      p1+=size; \
    } \
@@ -771,9 +756,9 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
    p1=p; \
    for (component=0; component < components; component++) \
    { \
-     length+=FormatMagickString(buffer+length,MaxTextExtent-length, \
+     length+=FormatLocaleString(buffer+length,MaxTextExtent-length, \
        format", ",arg1, arg2); \
-     if (length >= MaxTextExtent - 1) \
+     if (length >= (MaxTextExtent-1)) \
        length=MaxTextExtent-1; \
      p1+=size; \
    } \
@@ -1090,30 +1075,29 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
   EndianType
     endian;
 
-  ssize_t
-    all,
-    id,
-    level,
-    tag_value;
+  MagickBooleanType
+    status;
 
   register ssize_t
     i;
 
   size_t
-    length;
+    entry,
+    length,
+    number_entries,
+    tag_offset,
+    tag;
 
   ssize_t
-    offset;
+    all,
+    id,
+    level,
+    offset,
+    tag_value;
 
   static int
     tag_bytes[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8};
 
-  size_t
-    entry,
-    number_entries,
-    tag_offset,
-    tag;
-
   /*
     If EXIF data exists, then try to parse the request for a tag.
   */
@@ -1238,12 +1222,13 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
   /*
     This the offset to the first IFD.
   */
-  offset=(int) ReadPropertyLong(endian,exif+4);
+  offset=(ssize_t) ((int) ReadPropertyLong(endian,exif+4));
   if ((size_t) offset >= length)
     return(MagickFalse);
   /*
     Set the pointer to the first IFD and follow it were it leads.
   */
+  status=MagickFalse;
   directory=exif+offset;
   level=0;
   entry=0;
@@ -1266,25 +1251,23 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
     number_entries=ReadPropertyShort(endian,directory);
     for ( ; entry < number_entries; entry++)
     {
-      ssize_t
-        components;
-
       register unsigned char
         *p,
         *q;
 
       size_t
+        format,
         number_bytes;
 
-      size_t
-        format;
+      ssize_t
+        components;
 
       q=(unsigned char *) (directory+2+(12*entry));
       tag_value=(ssize_t) (ReadPropertyShort(endian,q)+tag_offset);
       format=(size_t) ReadPropertyShort(endian,q+2);
       if (format >= (sizeof(tag_bytes)/sizeof(*tag_bytes)))
         break;
-      components=(int) ReadPropertyLong(endian,q+4);
+      components=(ssize_t) ((int) ReadPropertyLong(endian,q+4));
       number_bytes=(size_t) components*tag_bytes[format];
       if (number_bytes <= 4)
         p=q+8;
@@ -1296,7 +1279,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
           /*
             The directory entry contains an offset.
           */
-          offset=(int) ReadPropertyLong(endian,q+8);
+          offset=(ssize_t) ((int) ReadPropertyLong(endian,q+8));
           if ((size_t) (offset+number_bytes) > length)
             continue;
           p=(unsigned char *) (exif+offset);
@@ -1420,21 +1403,21 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
                         break;
                       }
                   }
-                  (void) FormatMagickString(key,MaxTextExtent,"%s",
+                  (void) FormatLocaleString(key,MaxTextExtent,"%s",
                     description);
                   break;
                 }
                 case 2:
                 {
                   if (tag_value < 0x10000)
-                    (void) FormatMagickString(key,MaxTextExtent,"#%04lx",
+                    (void) FormatLocaleString(key,MaxTextExtent,"#%04lx",
                       (unsigned long) tag_value);
                   else
                     if (tag_value < 0x20000)
-                      (void) FormatMagickString(key,MaxTextExtent,"@%04lx",
+                      (void) FormatLocaleString(key,MaxTextExtent,"@%04lx",
                         (unsigned long) (tag_value & 0xffff));
                     else
-                      (void) FormatMagickString(key,MaxTextExtent,"unknown");
+                      (void) FormatLocaleString(key,MaxTextExtent,"unknown");
                   break;
                 }
               }
@@ -1445,6 +1428,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
               if (p == (const char *) NULL)
                 (void) SetImageProperty((Image *) image,key,value);
               value=DestroyString(value);
+              status=MagickTrue;
             }
         }
         if ((tag_value == TAG_EXIF_OFFSET) ||
@@ -1487,7 +1471,7 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
           }
     }
   } while (level > 0);
-  return(MagickTrue);
+  return(status);
 }
 
 static MagickBooleanType GetXMPProperty(const Image *image,
@@ -1575,11 +1559,6 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
     *path,
     *message;
 
-  ssize_t
-    knot_count,
-    selector,
-    y;
-
   MagickBooleanType
     in_subpath;
 
@@ -1592,30 +1571,35 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
     i,
     x;
 
+  ssize_t
+    knot_count,
+    selector,
+    y;
+
   path=AcquireString((char *) NULL);
   if (path == (char *) NULL)
     return((char *) NULL);
   message=AcquireString((char *) NULL);
-  (void) FormatMagickString(message,MaxTextExtent,"/ClipImage\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"/ClipImage\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"{\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"{\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"  /c {curveto} bind def\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"  /c {curveto} bind def\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"  /l {lineto} bind def\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"  /l {lineto} bind def\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"  /m {moveto} bind def\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"  /m {moveto} bind def\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "  /v {currentpoint 6 2 roll curveto} bind def\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "  /y {2 copy curveto} bind def\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "  /z {closepath} bind def\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"  newpath\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"  newpath\n");
   (void) ConcatenateString(&path,message);
   /*
     The clipping path format is defined in "Adobe Photoshop File
@@ -1667,7 +1651,7 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
         */
         for (i=0; i < 3; i++)
         {
-          size_t 
+          size_t
             xx,
             yy;
 
@@ -1675,16 +1659,16 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
           xx=ReadPropertyMSBLong(&blob,&length);
           x=(ssize_t) xx;
           if (xx > 2147483647)
-            x=(ssize_t) xx-4294967295-1;
+            x=(ssize_t) xx-4294967295U-1;
           y=(ssize_t) yy;
           if (yy > 2147483647)
-            y=(ssize_t) yy-4294967295-1;
+            y=(ssize_t) yy-4294967295U-1;
           point[i].x=(double) x/4096/4096;
           point[i].y=1.0-(double) y/4096/4096;
         }
         if (in_subpath == MagickFalse)
           {
-            (void) FormatMagickString(message,MaxTextExtent,"  %g %g m\n",
+            (void) FormatLocaleString(message,MaxTextExtent,"  %g %g m\n",
               point[1].x,point[1].y);
             for (i=0; i < 3; i++)
             {
@@ -1700,20 +1684,20 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
             */
             if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
                 (point[0].x == point[1].x) && (point[0].y == point[1].y))
-              (void) FormatMagickString(message,MaxTextExtent,
+              (void) FormatLocaleString(message,MaxTextExtent,
                 "  %g %g l\n",point[1].x,point[1].y);
             else
               if ((last[1].x == last[2].x) && (last[1].y == last[2].y))
-                (void) FormatMagickString(message,MaxTextExtent,
+                (void) FormatLocaleString(message,MaxTextExtent,
                   "  %g %g %g %g v\n",point[0].x,point[0].y,
                   point[1].x,point[1].y);
               else
                 if ((point[0].x == point[1].x) && (point[0].y == point[1].y))
-                  (void) FormatMagickString(message,MaxTextExtent,
+                  (void) FormatLocaleString(message,MaxTextExtent,
                     "  %g %g %g %g y\n",last[2].x,last[2].y,
                     point[1].x,point[1].y);
                 else
-                  (void) FormatMagickString(message,MaxTextExtent,
+                  (void) FormatLocaleString(message,MaxTextExtent,
                     "  %g %g %g %g %g %g c\n",last[2].x,
                     last[2].y,point[0].x,point[0].y,point[1].x,point[1].y);
             for (i=0; i < 3; i++)
@@ -1733,20 +1717,20 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
             */
             if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
                 (first[0].x == first[1].x) && (first[0].y == first[1].y))
-              (void) FormatMagickString(message,MaxTextExtent,
+              (void) FormatLocaleString(message,MaxTextExtent,
                 "  %g %g l z\n",first[1].x,first[1].y);
             else
               if ((last[1].x == last[2].x) && (last[1].y == last[2].y))
-                (void) FormatMagickString(message,MaxTextExtent,
+                (void) FormatLocaleString(message,MaxTextExtent,
                   "  %g %g %g %g v z\n",first[0].x,first[0].y,
                   first[1].x,first[1].y);
               else
                 if ((first[0].x == first[1].x) && (first[0].y == first[1].y))
-                  (void) FormatMagickString(message,MaxTextExtent,
+                  (void) FormatLocaleString(message,MaxTextExtent,
                     "  %g %g %g %g y z\n",last[2].x,last[2].y,
                     first[1].x,first[1].y);
                 else
-                  (void) FormatMagickString(message,MaxTextExtent,
+                  (void) FormatLocaleString(message,MaxTextExtent,
                     "  %g %g %g %g %g %g c z\n",last[2].x,
                     last[2].y,first[0].x,first[0].y,first[1].x,first[1].y);
             (void) ConcatenateString(&path,message);
@@ -1768,9 +1752,9 @@ static char *TracePSClippath(const unsigned char *blob,size_t length,
   /*
     Returns an empty PS path if the path has no knots.
   */
-  (void) FormatMagickString(message,MaxTextExtent,"  eoclip\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"  eoclip\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"} bind def");
+  (void) FormatLocaleString(message,MaxTextExtent,"} bind def");
   (void) ConcatenateString(&path,message);
   message=DestroyString(message);
   return(path);
@@ -1783,12 +1767,6 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
     *path,
     *message;
 
-  ssize_t
-    knot_count,
-    selector,
-    x,
-    y;
-
   MagickBooleanType
     in_subpath;
 
@@ -1800,22 +1778,28 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
   register ssize_t
     i;
 
+  ssize_t
+    knot_count,
+    selector,
+    x,
+    y;
+
   path=AcquireString((char *) NULL);
   if (path == (char *) NULL)
     return((char *) NULL);
   message=AcquireString((char *) NULL);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "<svg width=\"%.20g\" height=\"%.20g\">\n",(double) columns,(double) rows);
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"<g>\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"<g>\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "<path style=\"fill:#00000000;stroke:#00000000;");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,
+  (void) FormatLocaleString(message,MaxTextExtent,
     "stroke-width:0;stroke-antialiasing:false\" d=\"\n");
   (void) ConcatenateString(&path,message);
   (void) ResetMagickMemory(point,0,sizeof(point));
@@ -1864,7 +1848,7 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
         */
         for (i=0; i < 3; i++)
         {
-          size_t 
+          size_t
             xx,
             yy;
 
@@ -1872,16 +1856,16 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
           xx=ReadPropertyMSBLong(&blob,&length);
           x=(ssize_t) xx;
           if (xx > 2147483647)
-            x=(ssize_t) xx-4294967295-1;
+            x=(ssize_t) xx-4294967295U-1;
           y=(ssize_t) yy;
           if (yy > 2147483647)
-            y=(ssize_t) yy-4294967295-1;
+            y=(ssize_t) yy-4294967295U-1;
           point[i].x=(double) x*columns/4096/4096;
           point[i].y=(double) y*rows/4096/4096;
         }
         if (in_subpath == MagickFalse)
           {
-            (void) FormatMagickString(message,MaxTextExtent,"M %g,%g\n",
+            (void) FormatLocaleString(message,MaxTextExtent,"M %g,%g\n",
               point[1].x,point[1].y);
             for (i=0; i < 3; i++)
             {
@@ -1893,10 +1877,10 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
           {
             if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
                 (point[0].x == point[1].x) && (point[0].y == point[1].y))
-              (void) FormatMagickString(message,MaxTextExtent,"L %g,%g\n",
+              (void) FormatLocaleString(message,MaxTextExtent,"L %g,%g\n",
                 point[1].x,point[1].y);
             else
-              (void) FormatMagickString(message,MaxTextExtent,
+              (void) FormatLocaleString(message,MaxTextExtent,
                 "C %g,%g %g,%g %g,%g\n",last[2].x,last[2].y,
                 point[0].x,point[0].y,point[1].x,point[1].y);
             for (i=0; i < 3; i++)
@@ -1912,11 +1896,11 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
           {
             if ((last[1].x == last[2].x) && (last[1].y == last[2].y) &&
                 (first[0].x == first[1].x) && (first[0].y == first[1].y))
-              (void) FormatMagickString(message,MaxTextExtent,
+              (void) FormatLocaleString(message,MaxTextExtent,
                 "L %g,%g Z\n",first[1].x,first[1].y);
             else
               {
-                (void) FormatMagickString(message,MaxTextExtent,
+                (void) FormatLocaleString(message,MaxTextExtent,
                   "C %g,%g %g,%g %g,%g Z\n",last[2].x,
                   last[2].y,first[0].x,first[0].y,first[1].x,first[1].y);
                 (void) ConcatenateString(&path,message);
@@ -1939,11 +1923,11 @@ static char *TraceSVGClippath(const unsigned char *blob,size_t length,
   /*
     Return an empty SVG image if the path does not have knots.
   */
-  (void) FormatMagickString(message,MaxTextExtent,"\"/>\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"\"/>\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"</g>\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"</g>\n");
   (void) ConcatenateString(&path,message);
-  (void) FormatMagickString(message,MaxTextExtent,"</svg>\n");
+  (void) FormatLocaleString(message,MaxTextExtent,"</svg>\n");
   (void) ConcatenateString(&path,message);
   message=DestroyString(message);
   return(path);
@@ -1972,21 +1956,25 @@ MagickExport const char *GetImageProperty(const Image *image,
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   p=(const char *) NULL;
-  if (property == (const char *) NULL)
-    {
-      ResetSplayTreeIterator((SplayTreeInfo *) image->properties);
-      p=(const char *) GetNextValueInSplayTree((SplayTreeInfo *)
-        image->properties);
-      return(p);
-    }
   if (image->properties != (void *) NULL)
     {
-      p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
-        image->properties,property);
-      if (p != (const char *) NULL)
-        return(p);
+      if (property == (const char *) NULL)
+        {
+          ResetSplayTreeIterator((SplayTreeInfo *) image->properties);
+          p=(const char *) GetNextValueInSplayTree((SplayTreeInfo *)
+            image->properties);
+          return(p);
+        }
+      if (LocaleNCompare("fx:",property,3) != 0)
+        {
+          p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
+            image->properties,property);
+          if (p != (const char *) NULL)
+            return(p);
+        }
     }
-  if (strchr(property,':') == (char *) NULL)
+  if ((property == (const char *) NULL) ||
+      (strchr(property,':') == (char *) NULL))
     return(p);
   exception=(&((Image *) image)->exception);
   switch (*property)
@@ -1995,7 +1983,8 @@ MagickExport const char *GetImageProperty(const Image *image,
     {
       if (LocaleNCompare("8bim:",property,5) == 0)
         {
-          if (Get8BIMProperty(image,property) != MagickFalse)
+          if ((Get8BIMProperty(image,property) != MagickFalse) &&
+              (image->properties != (void *) NULL))
             {
               p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
                 image->properties,property);
@@ -2009,7 +1998,8 @@ MagickExport const char *GetImageProperty(const Image *image,
     {
       if (LocaleNCompare("exif:",property,5) == 0)
         {
-          if (GetEXIFProperty(image,property) != MagickFalse)
+          if ((GetEXIFProperty(image,property) != MagickFalse) &&
+              (image->properties != (void *) NULL))
             {
               p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
                 image->properties,property);
@@ -2024,20 +2014,24 @@ MagickExport const char *GetImageProperty(const Image *image,
       if (LocaleNCompare("fx:",property,3) == 0)
         {
           fx_info=AcquireFxInfo(image,property+3);
-          status=FxEvaluateExpression(fx_info,&alpha,exception);
+          status=FxEvaluateChannelExpression(fx_info,DefaultChannels,0,0,&alpha,
+            exception);
           fx_info=DestroyFxInfo(fx_info);
           if (status != MagickFalse)
             {
               char
                 value[MaxTextExtent];
 
-              (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+              (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
                 GetMagickPrecision(),(double) alpha);
               (void) SetImageProperty((Image *) image,property,value);
             }
-          p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
-            image->properties,property);
-          return(p);
+          if (image->properties != (void *) NULL)
+            {
+              p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
+                image->properties,property);
+              return(p);
+            }
         }
       break;
     }
@@ -2046,7 +2040,8 @@ MagickExport const char *GetImageProperty(const Image *image,
     {
       if (LocaleNCompare("iptc:",property,5) == 0)
         {
-          if (GetIPTCProperty(image,property) != MagickFalse)
+          if ((GetIPTCProperty(image,property) != MagickFalse) &&
+              (image->properties != (void *) NULL))
             {
               p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
                 image->properties,property);
@@ -2102,7 +2097,8 @@ MagickExport const char *GetImageProperty(const Image *image,
     {
       if (LocaleNCompare("xmp:",property,4) == 0)
         {
-          if (GetXMPProperty(image,property) != MagickFalse)
+          if ((GetXMPProperty(image,property) != MagickFalse) &&
+              (image->properties != (void *) NULL))
             {
               p=(const char *) GetValueFromSplayTree((SplayTreeInfo *)
                 image->properties,property);
@@ -2111,6 +2107,8 @@ MagickExport const char *GetImageProperty(const Image *image,
         }
       break;
     }
+    default:
+      break;
   }
   return(p);
 }
@@ -2169,8 +2167,8 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
           /*
             Image channels.
           */
-          (void) FormatMagickString(value,MaxTextExtent,"%s",
-            MagickOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
+          (void) FormatLocaleString(value,MaxTextExtent,"%s",
+            CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
             image->colorspace));
           LocaleLower(value);
           if (image->matte != MagickFalse)
@@ -2188,18 +2186,23 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
           colorspace=image->colorspace;
           if (IsGrayImage(image,&image->exception) != MagickFalse)
             colorspace=GRAYColorspace;
-          (void) FormatMagickString(value,MaxTextExtent,"%s",
-            MagickOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
+          (void) FormatLocaleString(value,MaxTextExtent,"%s",
+            CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
             colorspace));
           break;
         }
+      if (LocaleNCompare("copyright",property,9) == 0)
+        {
+          (void) CopyMagickString(value,GetMagickCopyright(),MaxTextExtent);
+          break;
+        }
       break;
     }
     case 'd':
     {
       if (LocaleNCompare("depth",property,5) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
             image->depth);
           break;
         }
@@ -2225,7 +2228,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
     {
       if (LocaleNCompare("group",property,5) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"0x%lx",
+          (void) FormatLocaleString(value,MaxTextExtent,"0x%lx",
             (unsigned long) image_info->group);
           break;
         }
@@ -2235,7 +2238,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
     {
       if (LocaleNCompare("height",property,6) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%.20g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.20g",
             image->magick_rows != 0 ? (double) image->magick_rows : 256.0);
           break;
         }
@@ -2260,7 +2263,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
 
           (void) GetImageChannelKurtosis(image,image_info->channel,&kurtosis,
             &skewness,&image->exception);
-          (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),kurtosis);
           break;
         }
@@ -2281,7 +2284,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
 
           (void) GetImageChannelRange(image,image_info->channel,&minimum,
             &maximum,&image->exception);
-          (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),maximum);
           break;
         }
@@ -2293,7 +2296,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
 
           (void) GetImageChannelMean(image,image_info->channel,&mean,
             &standard_deviation,&image->exception);
-          (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),mean);
           break;
         }
@@ -2305,7 +2308,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
 
           (void) GetImageChannelRange(image,image_info->channel,&minimum,
             &maximum,&image->exception);
-          (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),minimum);
           break;
         }
@@ -2322,6 +2325,16 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
     }
     case 'o':
     {
+      if (LocaleNCompare("opaque",property,6) == 0)
+        {
+          MagickBooleanType
+            opaque;
+
+          opaque=IsOpaqueImage(image,&image->exception);
+          (void) CopyMagickString(value,opaque == MagickFalse ? "false" :
+            "true",MaxTextExtent);
+          break;
+        }
       if (LocaleNCompare("output",property,6) == 0)
         {
           (void) CopyMagickString(value,image_info->filename,MaxTextExtent);
@@ -2333,17 +2346,8 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
     {
       if (LocaleNCompare("page",property,4) == 0)
         {
-          register const Image
-            *p;
-
-          size_t
-            page;
-
-          p=image;
-          for (page=1; GetPreviousImageInList(p) != (Image *) NULL; page++)
-            p=GetPreviousImageInList(p);
-          (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
-            page);
+          (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
+              GetImageIndexInList(image)+1);
           break;
         }
       break;
@@ -2356,21 +2360,21 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
             format[MaxTextExtent];
 
           (void) FormatMagickSize(GetBlobSize(image),MagickFalse,format);
-          (void) FormatMagickString(value,MaxTextExtent,"%sB",format);
+          (void) FormatLocaleString(value,MaxTextExtent,"%sB",format);
           break;
         }
       if (LocaleNCompare("scenes",property,6) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
             GetImageListLength(image));
           break;
         }
       if (LocaleNCompare("scene",property,5) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+          (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
             image->scene);
           if (image_info->number_scenes != 0)
-            (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
+            (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
               image_info->scene);
           break;
         }
@@ -2382,7 +2386,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
 
           (void) GetImageChannelKurtosis(image,image_info->channel,&kurtosis,
             &skewness,&image->exception);
-          (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),skewness);
           break;
         }
@@ -2395,7 +2399,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
 
           (void) GetImageChannelMean(image,image_info->channel,&mean,
             &standard_deviation,&image->exception);
-          (void) FormatMagickString(value,MaxTextExtent,"%.*g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%.*g",
             GetMagickPrecision(),standard_deviation);
           break;
         }
@@ -2411,11 +2415,21 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
         }
       break;
     }
+    case 'v':
+    {
+      if (LocaleNCompare("version",property,7) == 0)
+        {
+          (void) CopyMagickString(value,GetMagickVersion((size_t *) NULL),
+            MaxTextExtent);
+          break;
+        }
+      break;
+    }
     case 'w':
     {
       if (LocaleNCompare("width",property,5) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double) 
+          (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
             (image->magick_columns != 0 ? image->magick_columns : 256));
           break;
         }
@@ -2425,7 +2439,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
     {
       if (LocaleNCompare("xresolution",property,11) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%g",
             image->x_resolution);
           break;
         }
@@ -2435,7 +2449,7 @@ MagickExport const char *GetMagickProperty(const ImageInfo *image_info,
     {
       if (LocaleNCompare("yresolution",property,11) == 0)
         {
-          (void) FormatMagickString(value,MaxTextExtent,"%g",
+          (void) FormatLocaleString(value,MaxTextExtent,"%g",
             image->y_resolution);
           break;
         }
@@ -2537,9 +2551,6 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
   const char
     *value;
 
-  ImageInfo
-    *text_info;
-
   register char
     *q;
 
@@ -2566,7 +2577,6 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
   /*
     Translate any embedded format characters.
   */
-  text_info=CloneImageInfo(image_info);
   interpret_text=AcquireString(text);
   extent=MaxTextExtent;
   p=text;
@@ -2619,7 +2629,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           File size.
         */
-        (void) FormatMagickString(format,MaxTextExtent,"%.20g",(double)
+        (void) FormatLocaleString(format,MaxTextExtent,"%.20g",(double)
           image->extent);
         if (image->extent != (MagickSizeType) ((size_t) image->extent))
           (void) FormatMagickSize(image->extent,MagickFalse,format);
@@ -2639,8 +2649,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         if ((size_t) (q-interpret_text+length+1) >= extent)
           {
             extent+=length;
-            interpret_text=(char *) ResizeQuantumMemory(interpret_text,
-              extent+MaxTextExtent,sizeof(*interpret_text));
+            interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+
+              MaxTextExtent,sizeof(*interpret_text));
             if (interpret_text == (char *) NULL)
               break;
             q=interpret_text+strlen(interpret_text);
@@ -2705,9 +2715,9 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image geometry.
         */
-        q+=FormatMagickString(q,extent,"%.20gx%.20g%+.20g%+.20g",(double)
-          image->page.width,(double) image->page.height,(double)
-          image->page.x,(double) image->page.y);
+        q+=FormatLocaleString(q,extent,"%.20gx%.20g%+.20g%+.20g",(double)
+          image->page.width,(double) image->page.height,(double) image->page.x,
+          (double) image->page.y);
         break;
       }
       case 'h':
@@ -2715,8 +2725,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image height.
         */
-        q+=FormatMagickString(q,extent,"%.20g",(double)
-          (image->rows != 0 ? image->rows : image->magick_rows));
+        q+=FormatLocaleString(q,extent,"%.20g",(double) (image->rows != 0 ?
+          image->rows : image->magick_rows));
         break;
       }
       case 'i':
@@ -2732,8 +2742,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Number of unique colors.
         */
-        q+=FormatMagickString(q,extent,"%.20g",(double)
-          GetNumberColors(image,(FILE *) NULL,&image->exception));
+        q+=FormatLocaleString(q,extent,"%.20g",(double) GetNumberColors(image,
+          (FILE *) NULL,&image->exception));
         break;
       }
       case 'l':
@@ -2748,8 +2758,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         if ((size_t) (q-interpret_text+length+1) >= extent)
           {
             extent+=length;
-            interpret_text=(char *) ResizeQuantumMemory(interpret_text,
-              extent+MaxTextExtent,sizeof(*interpret_text));
+            interpret_text=(char *) ResizeQuantumMemory(interpret_text,extent+
+              MaxTextExtent,sizeof(*interpret_text));
             if (interpret_text == (char *) NULL)
               break;
             q=interpret_text+strlen(interpret_text);
@@ -2778,8 +2788,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Number of images in the list.
         */
-        q+=FormatMagickString(q,extent,"%.20g",(double)
-          GetImageListLength(image));
+        q+=FormatLocaleString(q,extent,"%.20g",(double)
+             GetImageListLength(image));
         break;
       }
       case 'o':
@@ -2787,24 +2797,16 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image output filename.
         */
-        q+=CopyMagickString(q,text_info->filename,extent);
+        q+=CopyMagickString(q,image_info->filename,extent);
         break;
       }
       case 'p':
       {
-        register const Image
-          *p;
-
-        size_t
-          page;
-
         /*
-          Image page number.
+          Image index in list.
         */
-        p=image;
-        for (page=1; GetPreviousImageInList(p) != (Image *) NULL; page++)
-          p=GetPreviousImageInList(p);
-        q+=FormatMagickString(q,extent,"%.20g",(double) page);
+        q+=FormatLocaleString(q,extent,"%.20g",(double)
+            GetImageIndexInList(image));
         break;
       }
       case 'q':
@@ -2812,7 +2814,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image depth.
         */
-        q+=FormatMagickString(q,extent,"%.20g",(double) image->depth);
+        q+=FormatLocaleString(q,extent,"%.20g",(double)
+          MAGICKCORE_QUANTUM_DEPTH);
         break;
       }
       case 'r':
@@ -2826,9 +2829,9 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         colorspace=image->colorspace;
         if (IsGrayImage(image,&image->exception) != MagickFalse)
           colorspace=GRAYColorspace;
-        q+=FormatMagickString(q,extent,"%s%s%s",MagickOptionToMnemonic(
+        q+=FormatLocaleString(q,extent,"%s%s%s",CommandOptionToMnemonic(
           MagickClassOptions,(ssize_t) image->storage_class),
-          MagickOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace),
+          CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace),
           image->matte != MagickFalse ? "Matte" : "");
         break;
       }
@@ -2837,10 +2840,10 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image scene number.
         */
-        if (text_info->number_scenes == 0)
-          q+=FormatMagickString(q,extent,"%.20g",(double) image->scene);
+        if (image_info->number_scenes == 0)
+          q+=FormatLocaleString(q,extent,"%.20g",(double) image->scene);
         else
-          q+=FormatMagickString(q,extent,"%.20g",(double) text_info->scene);
+          q+=FormatLocaleString(q,extent,"%.20g",(double) image_info->scene);
         break;
       }
       case 'u':
@@ -2848,7 +2851,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Unique filename.
         */
-        (void) CopyMagickString(filename,text_info->unique,extent);
+        (void) CopyMagickString(filename,image_info->unique,extent);
         q+=CopyMagickString(q,filename,extent);
         break;
       }
@@ -2857,8 +2860,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image width.
         */
-        q+=FormatMagickString(q,extent,"%.20g",(double)
-          (image->columns != 0 ? image->columns : image->magick_columns));
+        q+=FormatLocaleString(q,extent,"%.20g",(double) (image->columns != 0 ?
+          image->columns : image->magick_columns));
         break;
       }
       case 'x':
@@ -2866,8 +2869,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image horizontal resolution.
         */
-        q+=FormatMagickString(q,extent,"%g %s",image->x_resolution,
-          MagickOptionToMnemonic(MagickResolutionOptions,(ssize_t)
+        q+=FormatLocaleString(q,extent,"%g %s",image->x_resolution,
+          CommandOptionToMnemonic(MagickResolutionOptions,(ssize_t)
             image->units));
         break;
       }
@@ -2876,8 +2879,8 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image vertical resolution.
         */
-        q+=FormatMagickString(q,extent,"%g %s",image->y_resolution,
-          MagickOptionToMnemonic(MagickResolutionOptions,(ssize_t)
+        q+=FormatLocaleString(q,extent,"%g %s",image->y_resolution,
+          CommandOptionToMnemonic(MagickResolutionOptions,(ssize_t)
           image->units));
         break;
       }
@@ -2886,7 +2889,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image depth.
         */
-        q+=FormatMagickString(q,extent,"%.20g",(double) image->depth);
+        q+=FormatLocaleString(q,extent,"%.20g",(double) image->depth);
         break;
       }
       case 'A':
@@ -2894,7 +2897,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image alpha channel.
         */
-        q+=FormatMagickString(q,extent,"%s",MagickOptionToMnemonic(
+        q+=FormatLocaleString(q,extent,"%s",CommandOptionToMnemonic(
           MagickBooleanOptions,(ssize_t) image->matte));
         break;
       }
@@ -2903,7 +2906,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image compression method.
         */
-        q+=FormatMagickString(q,extent,"%s",MagickOptionToMnemonic(
+        q+=FormatLocaleString(q,extent,"%s",CommandOptionToMnemonic(
           MagickCompressOptions,(ssize_t) image->compression));
         break;
       }
@@ -2912,37 +2915,36 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image dispose method.
         */
-        q+=FormatMagickString(q,extent,"%s",MagickOptionToMnemonic(
+        q+=FormatLocaleString(q,extent,"%s",CommandOptionToMnemonic(
           MagickDisposeOptions,(ssize_t) image->dispose));
         break;
       }
       case 'G':
       {
-        q+=FormatMagickString(q,extent,"%.20gx%.20g",(double)
+        q+=FormatLocaleString(q,extent,"%.20gx%.20g",(double)
           image->magick_columns,(double) image->magick_rows);
         break;
       }
       case 'H':
       {
-        q+=FormatMagickString(q,extent,"%.20g",(double)
-          image->page.height);
+        q+=FormatLocaleString(q,extent,"%.20g",(double) image->page.height);
         break;
       }
       case 'O':
       {
-        q+=FormatMagickString(q,extent,"%+ld%+ld",(long) image->page.x,
-          (long) image->page.y);
+        q+=FormatLocaleString(q,extent,"%+ld%+ld",(long) image->page.x,(long)
+          image->page.y);
         break;
       }
       case 'P':
       {
-        q+=FormatMagickString(q,extent,"%.20gx%.20g",(double) image->page.width,
+        q+=FormatLocaleString(q,extent,"%.20gx%.20g",(double) image->page.width,
           (double) image->page.height);
         break;
       }
       case 'Q':
       {
-        q+=FormatMagickString(q,extent,"%.20g",(double) image->quality);
+        q+=FormatLocaleString(q,extent,"%.20g",(double) image->quality);
         break;
       }
       case 'S':
@@ -2950,31 +2952,31 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Image scenes.
         */
-        if (text_info->number_scenes == 0)
+        if (image_info->number_scenes == 0)
           q+=CopyMagickString(q,"2147483647",extent);
         else
-          q+=FormatMagickString(q,extent,"%.20g",(double)
-            (text_info->scene+text_info->number_scenes));
+          q+=FormatLocaleString(q,extent,"%.20g",(double) (image_info->scene+
+            image_info->number_scenes));
         break;
       }
       case 'T':
       {
-        q+=FormatMagickString(q,extent,"%.20g",(double) image->delay);
+        q+=FormatLocaleString(q,extent,"%.20g",(double) image->delay);
         break;
       }
       case 'W':
       {
-        q+=FormatMagickString(q,extent,"%.20g",(double) image->page.width);
+        q+=FormatLocaleString(q,extent,"%.20g",(double) image->page.width);
         break;
       }
       case 'X':
       {
-        q+=FormatMagickString(q,extent,"%+.20g",(double) image->page.x);
+        q+=FormatLocaleString(q,extent,"%+.20g",(double) image->page.x);
         break;
       }
       case 'Y':
       {
-        q+=FormatMagickString(q,extent,"%+.20g",(double) image->page.y);
+        q+=FormatLocaleString(q,extent,"%+.20g",(double) image->page.y);
         break;
       }
       case 'Z':
@@ -2982,7 +2984,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
         /*
           Unique filename.
         */
-        (void) CopyMagickString(filename,text_info->zero,extent);
+        (void) CopyMagickString(filename,image_info->zero,extent);
         q+=CopyMagickString(q,filename,extent);
         break;
       }
@@ -3059,13 +3061,13 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
                               break;
                             q=interpret_text+strlen(interpret_text);
                           }
-                        q+=FormatMagickString(q,extent,"%s=%s\n",key,value);
+                        q+=FormatLocaleString(q,extent,"%s=%s\n",key,value);
                       }
                   }
                 key=GetNextImageProperty(image);
               }
             }
-        value=GetMagickProperty(text_info,image,pattern);
+        value=GetMagickProperty(image_info,image,pattern);
         if (value != (const char *) NULL)
           {
             length=strlen(value);
@@ -3112,7 +3114,7 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
           Image bounding box.
         */
         page=GetImageBoundingBox(image,&image->exception);
-        q+=FormatMagickString(q,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
+        q+=FormatLocaleString(q,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g",
           (double) page.width,(double) page.height,(double) page.x,(double)
           page.y);
         break;
@@ -3143,7 +3145,6 @@ MagickExport char *InterpretImageProperties(const ImageInfo *image_info,
     }
   }
   *q='\0';
-  text_info=DestroyImageInfo(text_info);
   if (text != (const char *) embed_text)
     text=DestroyString(text);
   (void) SubstituteString(&interpret_text,"&lt;","<");
@@ -3308,7 +3309,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             colorspace;
 
-          colorspace=ParseMagickOption(MagickColorspaceOptions,MagickFalse,
+          colorspace=ParseCommandOption(MagickColorspaceOptions,MagickFalse,
             value);
           if (colorspace < 0)
             break;
@@ -3320,7 +3321,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             compose;
 
-          compose=ParseMagickOption(MagickComposeOptions,MagickFalse,value);
+          compose=ParseCommandOption(MagickComposeOptions,MagickFalse,value);
           if (compose < 0)
             break;
           image->compose=(CompositeOperator) compose;
@@ -3331,7 +3332,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             compression;
 
-          compression=ParseMagickOption(MagickCompressOptions,MagickFalse,
+          compression=ParseCommandOption(MagickCompressOptions,MagickFalse,
             value);
           if (compression < 0)
             break;
@@ -3390,7 +3391,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             dispose;
 
-          dispose=ParseMagickOption(MagickDisposeOptions,MagickFalse,value);
+          dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,value);
           if (dispose < 0)
             break;
           image->dispose=(DisposeType) dispose;
@@ -3408,7 +3409,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             gravity;
 
-          gravity=ParseMagickOption(MagickGravityOptions,MagickFalse,value);
+          gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,value);
           if (gravity < 0)
             break;
           image->gravity=(GravityType) gravity;
@@ -3426,7 +3427,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             rendering_intent;
 
-          rendering_intent=ParseMagickOption(MagickIntentOptions,MagickFalse,
+          rendering_intent=ParseCommandOption(MagickIntentOptions,MagickFalse,
             value);
           if (rendering_intent < 0)
             break;
@@ -3438,7 +3439,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             interpolate;
 
-          interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
+          interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
             value);
           if (interpolate < 0)
             break;
@@ -3503,7 +3504,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             rendering_intent;
 
-          rendering_intent=ParseMagickOption(MagickIntentOptions,MagickFalse,
+          rendering_intent=ParseCommandOption(MagickIntentOptions,MagickFalse,
             value);
           if (rendering_intent < 0)
             break;
@@ -3539,7 +3540,7 @@ MagickExport MagickBooleanType SetImageProperty(Image *image,
           ssize_t
             units;
 
-          units=ParseMagickOption(MagickResolutionOptions,MagickFalse,value);
+          units=ParseCommandOption(MagickResolutionOptions,MagickFalse,value);
           if (units < 0)
             break;
           image->units=(ResolutionType) units;