]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 14 Apr 2015 23:54:43 +0000 (23:54 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 14 Apr 2015 23:54:43 +0000 (23:54 +0000)
MagickCore/cache.c
MagickCore/identify.c
MagickCore/property.c
MagickCore/resize.c
MagickCore/resource.c
MagickCore/string.c
MagickCore/string_.h
coders/json.c

index 805a0186e868b14346c02e5f561d4c6bbacdaa30..29dd17dca9f01bb39504aea14e7a6d1bd0a00547 100644 (file)
@@ -3232,7 +3232,7 @@ static MagickBooleanType SetPixelCacheExtent(Image *image,MagickSizeType length)
         format[MaxTextExtent],
         message[MaxTextExtent];
 
-      (void) FormatMagickSize(length,MagickFalse,"B",format);
+      (void) FormatMagickSize(length,MagickFalse,"B",MaxTextExtent,format);
       (void) FormatLocaleString(message,MaxTextExtent,
         "extend %s (%s[%d], disk, %s)",cache_info->filename,
         cache_info->cache_filename,cache_info->file,format);
@@ -3364,7 +3364,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
               if (image->debug != MagickFalse)
                 {
                   (void) FormatMagickSize(cache_info->length,MagickTrue,"B",
-                    format);
+                    MaxTextExtent,format);
                   type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
                     cache_info->type);
                   (void) FormatLocaleString(message,MaxTextExtent,
@@ -3424,7 +3424,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
               if (image->debug != MagickFalse)
                 {
                   (void) FormatMagickSize(cache_info->length,MagickFalse,"B",
-                    format);
+                    MaxTextExtent,format);
                   type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
                     cache_info->type);
                   (void) FormatLocaleString(message,MaxTextExtent,
@@ -3507,7 +3507,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
               if (image->debug != MagickFalse)
                 {
                   (void) FormatMagickSize(cache_info->length,MagickTrue,"B",
-                    format);
+                    MaxTextExtent,format);
                   type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
                     cache_info->type);
                   (void) FormatLocaleString(message,MaxTextExtent,
@@ -3532,7 +3532,8 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode,
     }
   if (image->debug != MagickFalse)
     {
-      (void) FormatMagickSize(cache_info->length,MagickFalse,"B",format);
+      (void) FormatMagickSize(cache_info->length,MagickFalse,"B",MaxTextExtent,
+        format);
       type=CommandOptionToMnemonic(MagickCacheOptions,(ssize_t)
         cache_info->type);
       (void) FormatLocaleString(message,MaxTextExtent,
index 8b114208451c7a7496d6af0ab1305e6dacc28389..4cb815cc44c191767c4f006d330957f002aaccf8 100644 (file)
@@ -600,7 +600,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
           if (image->total_colors != 0)
             {
               (void) FormatMagickSize(image->total_colors,MagickFalse,"B",
-                format);
+                MaxTextExtent,format);
               (void) FormatLocaleFile(file,"%s ",format);
             }
         }
@@ -619,7 +619,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
       if (GetBlobSize(image) != 0)
         {
           (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",
-            format);
+            MaxTextExtent,format);
           (void) FormatLocaleFile(file,"%s ",format);
         }
       (void) FormatLocaleFile(file,"%0.3fu %lu:%02lu.%03lu",user_time,
@@ -1383,15 +1383,16 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file,
     }
   (void) FormatLocaleFile(file,"  Tainted: %s\n",CommandOptionToMnemonic(
     MagickBooleanOptions,(ssize_t) image->taint));
-  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",format);
+  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",MaxTextExtent,
+    format);
   (void) FormatLocaleFile(file,"  Filesize: %s\n",format);
   (void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
-    MagickFalse,"B",format);
+    MagickFalse,"B",MaxTextExtent,format);
   if (strlen(format) > 1)
     format[strlen(format)-1]='\0';
   (void) FormatLocaleFile(file,"  Number pixels: %s\n",format);
   (void) FormatMagickSize((MagickSizeType) ((double) image->columns*image->rows/
-    elapsed_time+0.5),MagickFalse,"B",format);
+    elapsed_time+0.5),MagickFalse,"B",MaxTextExtent,format);
   (void) FormatLocaleFile(file,"  Pixels per second: %s\n",format);
   (void) FormatLocaleFile(file,"  User time: %0.3fu\n",user_time);
   (void) FormatLocaleFile(file,"  Elapsed time: %lu:%02lu.%03lu\n",
index eb8ebc14bceca7986c950da06cda550725c4d172..728b13a4e4b563c76fe40808c01323ac0b492a03 100644 (file)
@@ -2289,7 +2289,8 @@ static const char *GetMagickPropertyLetter(ImageInfo *image_info,
     case 'b':  /* image size read in - in bytes */
     {
       WarnNoImageReturn("\"%%%c\"",letter);
-      (void) FormatMagickSize(image->extent,MagickFalse,"B",value);
+      (void) FormatMagickSize(image->extent,MagickFalse,"B",MaxTextExtent,
+        value);
       break;
     }
     case 'c':  /* image comment property - empty string by default */
@@ -2967,7 +2968,8 @@ MagickExport const char *GetMagickProperty(ImageInfo *image_info,
       if (LocaleCompare("size",property) == 0)
         {
           WarnNoImageReturn("\"%%[%s]\"",property);
-          (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",value);
+          (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",
+            MaxTextExtent,value);
           break;
         }
       if (LocaleCompare("skewness",property) == 0)
index b0a9c6677a513ed9b8a38e4fc6f59a41fdd9c7e2..00ccc13bac7e6e857cec6424dd960fc624dcf91f 100644 (file)
@@ -3704,7 +3704,8 @@ MagickExport Image *ThumbnailImage(const Image *image,const size_t columns,
     }
   (void) FormatLocaleString(value,MaxTextExtent,"%.20g",(double)
     attributes.st_mtime);
-  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",value);
+  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",MaxTextExtent,
+    value);
   (void) SetImageProperty(thumbnail_image,"Thumb::Size",value,exception);
   (void) FormatLocaleString(value,MaxTextExtent,"image/%s",image->magick);
   LocaleLower(value);
index 16c1979913bb8825d8639356f086634a0139d1d4..d4eea9f8bcbad26f5d1bf4ee5eefbf623f656058 100644 (file)
@@ -175,7 +175,7 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
     limit;
 
   status=MagickFalse;
-  (void) FormatMagickSize(size,MagickFalse,"B",resource_request);
+  (void) FormatMagickSize(size,MagickFalse,"B",MaxTextExtent,resource_request);
   if (resource_semaphore == (SemaphoreInfo *) NULL)
     ActivateSemaphoreInfo(&resource_semaphore);
   LockSemaphoreInfo(resource_semaphore);
@@ -188,9 +188,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
       status=(resource_info.area_limit == MagickResourceInfinity) ||
         (size < limit) ? MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.area,MagickFalse,
-        "B",resource_current);
-      (void) FormatMagickSize(resource_info.area_limit,MagickFalse,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_current);
+      (void) FormatMagickSize(resource_info.area_limit,MagickFalse,"B",
+        MaxTextExtent,resource_limit);
       break;
     }
     case MemoryResource:
@@ -201,9 +201,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
         ((MagickSizeType) resource_info.memory < limit) ? MagickTrue :
         MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.memory,MagickTrue,
-        "B",resource_current);
-      (void) FormatMagickSize(resource_info.memory_limit,MagickTrue,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_current);
+      (void) FormatMagickSize(resource_info.memory_limit,MagickTrue,"B",
+        MaxTextExtent,resource_limit);
       break;
     }
     case MapResource:
@@ -213,9 +213,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
       status=(resource_info.map_limit == MagickResourceInfinity) ||
         ((MagickSizeType) resource_info.map < limit) ? MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.map,MagickTrue,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.map_limit,MagickTrue,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_limit);
       break;
     }
     case DiskResource:
@@ -226,9 +226,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
         ((MagickSizeType) resource_info.disk < limit) ? MagickTrue :
         MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.disk,MagickTrue,
-        "B",resource_current);
-      (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_current);
+      (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,"B",
+        MaxTextExtent,resource_limit);
       break;
     }
     case FileResource:
@@ -239,9 +239,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
         ((MagickSizeType) resource_info.file < limit) ?
         MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.file,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.file_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case HeightResource:
@@ -251,9 +251,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
       status=(resource_info.area_limit == MagickResourceInfinity) ||
         (size < limit) ? MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.height,MagickFalse,
-        "P",resource_current);
+        "P",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.height_limit,MagickFalse,
-        "P",resource_limit);
+        "P",MaxTextExtent,resource_limit);
       break;
     }
     case ThreadResource:
@@ -263,9 +263,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
         ((MagickSizeType) resource_info.thread < limit) ?
         MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.thread,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.thread_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case ThrottleResource:
@@ -275,9 +275,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
         ((MagickSizeType) resource_info.throttle < limit) ?
         MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.throttle,
-        MagickFalse,"B",resource_current);
+        MagickFalse,"B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.throttle_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case TimeResource:
@@ -288,9 +288,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
         ((MagickSizeType) resource_info.time < limit) ?
         MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.time,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.time_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case WidthResource:
@@ -300,9 +300,9 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type,
       status=(resource_info.area_limit == MagickResourceInfinity) ||
         (size < limit) ? MagickTrue : MagickFalse;
       (void) FormatMagickSize((MagickSizeType) resource_info.width,MagickFalse,
-        "P",resource_current);
-      (void) FormatMagickSize(resource_info.width_limit,MagickFalse,
-        "P",resource_limit);
+        "P",MaxTextExtent,resource_current);
+      (void) FormatMagickSize(resource_info.width_limit,MagickFalse,"P",
+        MaxTextExtent,resource_limit);
       break;
     }
     default:
@@ -783,16 +783,19 @@ MagickExport MagickBooleanType ListMagickResourceInfo(FILE *file,
     ActivateSemaphoreInfo(&resource_semaphore);
   LockSemaphoreInfo(resource_semaphore);
   (void) FormatMagickSize(resource_info.width_limit,MagickFalse,"P",
-    width_limit);
+    MaxTextExtent,width_limit);
   (void) FormatMagickSize(resource_info.height_limit,MagickFalse,"P",
-    height_limit);
-  (void) FormatMagickSize(resource_info.area_limit,MagickFalse,"B",area_limit);
+    MaxTextExtent,height_limit);
+  (void) FormatMagickSize(resource_info.area_limit,MagickFalse,"B",
+    MaxTextExtent,area_limit);
   (void) FormatMagickSize(resource_info.memory_limit,MagickTrue,"B",
-    memory_limit);
-  (void) FormatMagickSize(resource_info.map_limit,MagickTrue,"B",map_limit);
+    MaxTextExtent,memory_limit);
+  (void) FormatMagickSize(resource_info.map_limit,MagickTrue,"B",
+    MaxTextExtent,map_limit);
   (void) CopyMagickString(disk_limit,"unlimited",MaxTextExtent);
   if (resource_info.disk_limit != MagickResourceInfinity)
-    (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,"B",disk_limit);
+    (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,"B",
+      MaxTextExtent,disk_limit);
   (void) CopyMagickString(time_limit,"unlimited",MaxTextExtent);
   if (resource_info.time_limit != MagickResourceInfinity)
     (void) FormatLocaleString(time_limit,MaxTextExtent,"%.20g",(double)
@@ -849,7 +852,7 @@ MagickExport void RelinquishMagickResource(const ResourceType type,
     resource_limit[MaxTextExtent],
     resource_request[MaxTextExtent];
 
-  (void) FormatMagickSize(size,MagickFalse,"B",resource_request);
+  (void) FormatMagickSize(size,MagickFalse,"B",MaxTextExtent,resource_request);
   if (resource_semaphore == (SemaphoreInfo *) NULL)
                ActivateSemaphoreInfo(&resource_semaphore);
   LockSemaphoreInfo(resource_semaphore);
@@ -859,88 +862,88 @@ MagickExport void RelinquishMagickResource(const ResourceType type,
     {
       resource_info.width=(MagickOffsetType) size;
       (void) FormatMagickSize((MagickSizeType) resource_info.width,MagickFalse,
-        "P",resource_current);
+        "P",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.width_limit,MagickFalse,
-        "P",resource_limit);
+        "P",MaxTextExtent,resource_limit);
       break;
     }
     case HeightResource:
     {
       resource_info.width=(MagickOffsetType) size;
       (void) FormatMagickSize((MagickSizeType) resource_info.width,MagickFalse,
-        "P",resource_current);
+        "P",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.width_limit,MagickFalse,
-        "P",resource_limit);
+        "P",MaxTextExtent,resource_limit);
       break;
     }
     case AreaResource:
     {
       resource_info.area=(MagickOffsetType) size;
       (void) FormatMagickSize((MagickSizeType) resource_info.area,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.area_limit,MagickFalse,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_limit);
       break;
     }
     case MemoryResource:
     {
       resource_info.memory-=size;
       (void) FormatMagickSize((MagickSizeType) resource_info.memory,
-        MagickTrue,"B",resource_current);
+        MagickTrue,"B",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.memory_limit,MagickTrue,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_limit);
       break;
     }
     case MapResource:
     {
       resource_info.map-=size;
       (void) FormatMagickSize((MagickSizeType) resource_info.map,MagickTrue,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.map_limit,MagickTrue,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_limit);
       break;
     }
     case DiskResource:
     {
       resource_info.disk-=size;
       (void) FormatMagickSize((MagickSizeType) resource_info.disk,MagickTrue,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize(resource_info.disk_limit,MagickTrue,
-        "B",resource_limit);
+        "B",MaxTextExtent,resource_limit);
       break;
     }
     case FileResource:
     {
       resource_info.file-=size;
       (void) FormatMagickSize((MagickSizeType) resource_info.file,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.file_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case ThreadResource:
     {
       (void) FormatMagickSize((MagickSizeType) resource_info.thread,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.thread_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case ThrottleResource:
     {
       (void) FormatMagickSize((MagickSizeType) resource_info.throttle,
-        MagickFalse,"B",resource_current);
+        MagickFalse,"B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.throttle_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     case TimeResource:
     {
       resource_info.time-=size;
       (void) FormatMagickSize((MagickSizeType) resource_info.time,MagickFalse,
-        "B",resource_current);
+        "B",MaxTextExtent,resource_current);
       (void) FormatMagickSize((MagickSizeType) resource_info.time_limit,
-        MagickFalse,"B",resource_limit);
+        MagickFalse,"B",MaxTextExtent,resource_limit);
       break;
     }
     default:
index 070555206dedf910c28ea8421fa5dc20d7338d18..349c6bbd80584569846632dab7fa4ca99c30721b 100644 (file)
@@ -1059,7 +1059,7 @@ MagickExport StringInfo *FileToStringInfo(const char *filename,
 %  The format of the FormatMagickSize method is:
 %
 %      ssize_t FormatMagickSize(const MagickSizeType size,const char *suffix,
-^        char *format)
+%        const size_t length,char *format)
 %
 %  A description of each parameter follows:
 %
@@ -1069,18 +1069,21 @@ MagickExport StringInfo *FileToStringInfo(const char *filename,
 %
 %    o suffix:  append suffix, typically B or P.
 %
+%    o length: the maximum length of the string.
+%
 %    o format:  human readable format.
 %
 */
 MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
-  const MagickBooleanType bi,const char *suffix,char *format)
+  const MagickBooleanType bi,const char *suffix,const size_t length,
+  char *format)
 {
   const char
     **units;
 
   double
     bytes,
-    length;
+    extent;
 
   register ssize_t
     i,
@@ -1107,21 +1110,21 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
       units=bi_units;
     }
 #if defined(_MSC_VER) && (_MSC_VER == 1200)
-  length=(double) ((MagickOffsetType) size);
+  extent=(double) ((MagickOffsetType) size);
 #else
-  length=(double) size;
+  extent=(double) size;
 #endif
-  for (i=0; (length >= bytes) && (units[i+1] != (const char *) NULL); i++)
-    length/=bytes;
+  for (i=0; (extent >= bytes) && (units[i+1] != (const char *) NULL); i++)
+    extent/=bytes;
   count=0;
   for (j=2; j < 12; j++)
   {
     if (suffix == (const char *) NULL)
-      count=FormatLocaleString(format,MaxTextExtent,"%.*g%s",(int) (i+j),
-        length,units[i]);
+      count=FormatLocaleString(format,length,"%.*g%s",(int) (i+j),extent,
+        units[i]);
     else
-      count=FormatLocaleString(format,MaxTextExtent,"%.*g%s%s",(int) (i+j),
-        length,units[i],suffix);
+      count=FormatLocaleString(format,length,"%.*g%s%s",(int) (i+j),extent,
+        units[i],suffix);
     if (strchr(format,'+') == (char *) NULL)
       break;
   }
@@ -1149,12 +1152,12 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
 %
 %  A description of each parameter follows.
 %
-%   o time:  the time since the Epoch (00:00:00 UTC, January 1, 1970),
-%     measured in seconds.
+%    o time:  the time since the Epoch (00:00:00 UTC, January 1, 1970),
+%      measured in seconds.
 %
-%   o length: the maximum length of the string.
+%    o length: the maximum length of the string.
 %
-%   o timestamp:  Return the Internet date/time here.
+%    o timestamp:  Return the Internet date/time here.
 %
 */
 MagickExport ssize_t FormatMagickTime(const time_t time,const size_t length,
index efb8eef16e63ee5ca06aa21dbbe57bbe7cbf2478..921718797ffa3b005fbb3a4d83088c9d915fda33 100644 (file)
@@ -79,7 +79,7 @@ extern MagickExport size_t
 
 extern MagickExport ssize_t
   FormatMagickSize(const MagickSizeType,const MagickBooleanType,const char *,
-    char *),
+    const size_t,char *),
   FormatMagickTime(const time_t,const size_t,char *);
 
 extern MagickExport StringInfo
index 0b8db165a97016ce9d313766dd6212aeceb4f254..ce1bb5ed01519689dd58b649cf902781fd1be4bc 100644 (file)
@@ -1336,15 +1336,16 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file,
     }
   (void) FormatLocaleFile(file,"  Tainted: %s\n",CommandOptionToMnemonic(
     MagickBooleanOptions,(ssize_t) image->taint));
-  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",format);
+  (void) FormatMagickSize(GetBlobSize(image),MagickFalse,"B",MaxTextExtent,
+    format);
   (void) FormatLocaleFile(file,"  Filesize: %s\n",format);
   (void) FormatMagickSize((MagickSizeType) image->columns*image->rows,
-    MagickFalse,"B",format);
+    MagickFalse,"B",MaxTextExtent,format);
   if (strlen(format) > 1)
     format[strlen(format)-1]='\0';
   (void) FormatLocaleFile(file,"  Number pixels: %s\n",format);
   (void) FormatMagickSize((MagickSizeType) ((double) image->columns*image->rows/
-    elapsed_time+0.5),MagickFalse,"B",format);
+    elapsed_time+0.5),MagickFalse,"B",MaxTextExtent,format);
   (void) FormatLocaleFile(file,"  Pixels per second: %s\n",format);
   (void) FormatLocaleFile(file,"  User time: %0.3fu\n",user_time);
   (void) FormatLocaleFile(file,"  Elapsed time: %lu:%02lu.%03lu\n",