]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 9 Apr 2017 13:58:41 +0000 (09:58 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 9 Apr 2017 13:58:41 +0000 (09:58 -0400)
MagickCore/string.c
configure

index 778f5ef8611fb6338b8784ed28fce878e648fd59..c397be5e01337392f40429785f45c08571bc836c 100644 (file)
@@ -1091,8 +1091,7 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
     extent;
 
   register ssize_t
-    i,
-    j;
+    i;
 
   ssize_t
     count;
@@ -1121,18 +1120,25 @@ MagickExport ssize_t FormatMagickSize(const MagickSizeType size,
 #endif
   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,length,"%.*g%s",GetMagickPrecision(),
-        extent,units[i]);
-    else
-      count=FormatLocaleString(format,length,"%.*g%s%s",GetMagickPrecision(),
-        extent,units[i],suffix);
-    if (strchr(format,'+') == (char *) NULL)
-      break;
-  }
+  if (suffix == (const char *) NULL)
+    count=FormatLocaleString(format,length,"%.*g%s",GetMagickPrecision(),
+      extent,units[i]);
+  else
+    count=FormatLocaleString(format,length,"%.*g%s%s",GetMagickPrecision(),
+      extent,units[i],suffix);
+  if (fabs(bytes*strtod(format,(char **) NULL)-size) < MagickEpsilon)
+    {
+#if defined(_MSC_VER) && (_MSC_VER == 1200)
+      extent=(double) ((MagickOffsetType) size);
+#else
+      extent=(double) size;
+#endif
+      if (suffix == (const char *) NULL)
+        count=FormatLocaleString(format,length,"%.20g%s",extent,units[0]);
+      else
+        count=FormatLocaleString(format,length,"%.20g%s%s",extent,units[0],
+          suffix);
+    }
   return(count);
 }
 \f
index 88d042029ac24cd11809dd82da417c847f3f2bb3..21c9b539698a312966687b6e7a90876d27afbdf5 100755 (executable)
--- a/configure
+++ b/configure
@@ -4519,7 +4519,7 @@ MAGICK_PATCHLEVEL_VERSION=5
 
 MAGICK_VERSION=7.0.5-5
 
-MAGICK_GIT_REVISION=19792:edaf686:20170401
+MAGICK_GIT_REVISION=19847:a36d866:20170409
 
 
 # Substitute library versioning