diff --git a/coders/bmp.c b/coders/bmp.c
index a1220c0..edc2939 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -620,8 +620,8 @@
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
               "  Format: OS/2 Bitmap");
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Geometry: %lux%lu",(unsigned long) bmp_info.width,
-              (unsigned long) bmp_info.height);
+              "  Geometry: %.20gx%.20g",(double) bmp_info.width,(double)
+              bmp_info.height);
           }
       }
     else
@@ -648,10 +648,10 @@
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
               "  Format: MS Windows bitmap");
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Geometry: %lux%lu",(unsigned long) bmp_info.width,
-              (unsigned long) bmp_info.height);
+              "  Geometry: %.20gx%.20g",(double) bmp_info.width,(double)
+              bmp_info.height);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Bits per pixel: %lu",(unsigned long) bmp_info.bits_per_pixel);
+              "  Bits per pixel: %.20g",(double) bmp_info.bits_per_pixel);
             switch ((int) bmp_info.compression)
             {
               case BI_RGB:
@@ -857,7 +857,7 @@
         */
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  Reading colormap of %lu colors",(unsigned long) image->colors);
+            "  Reading colormap of %.20g colors",(double) image->colors);
         if (AcquireImageColormap(image,image->colors) == MagickFalse)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t)
@@ -907,7 +907,7 @@
       {
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  Reading pixels (%lu bytes)",(unsigned long) length);
+            "  Reading pixels (%.20g bytes)",(double) length);
         count=ReadBlob(image,length,pixels);
         if (count != (ssize_t) length)
           ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
@@ -1830,7 +1830,7 @@
     if (image->debug != MagickFalse)
       {
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "   Writing BMP version %ld datastream",(long) type);
+          "   Writing BMP version %.20g datastream",(double) type);
         if (image->storage_class == DirectClass)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Storage class=DirectClass");
@@ -1838,7 +1838,7 @@
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Storage class=PseudoClass");
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "   Image depth=%lu",(unsigned long) image->depth);
+          "   Image depth=%.20g",(double) image->depth);
         if (image->matte != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Matte=True");
@@ -1846,7 +1846,7 @@
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Matte=MagickFalse");
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "   BMP bits_per_pixel=%lu",(unsigned long) bmp_info.bits_per_pixel);
+          "   BMP bits_per_pixel=%.20g",(double) bmp_info.bits_per_pixel);
         switch ((int) bmp_info.compression)
         {
            case BI_RGB:
@@ -2001,7 +2001,7 @@
         */
         if (image->debug != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "  Colormap: %lu entries",(unsigned long) image->colors);
+            "  Colormap: %.20g entries",(double) image->colors);
         bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t) (1UL <<
           bmp_info.bits_per_pixel),4*sizeof(*bmp_colormap));
         if (bmp_colormap == (unsigned char *) NULL)
diff --git a/coders/braille.c b/coders/braille.c
index 9dac8e5..d5509cf 100644
--- a/coders/braille.c
+++ b/coders/braille.c
@@ -228,21 +228,21 @@
       }
       if (image->page.x)
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"X: %ld\n",(long) 
+        (void) FormatMagickString(buffer,MaxTextExtent,"X: %.20g\n",(double) 
           image->page.x);
         (void) WriteBlobString(image,buffer);
       }
       if (image->page.y)
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"Y: %ld\n",(long) 
+        (void) FormatMagickString(buffer,MaxTextExtent,"Y: %.20g\n",(double) 
           image->page.y);
         (void) WriteBlobString(image,buffer);
       }
-      (void) FormatMagickString(buffer,MaxTextExtent,"Width: %lu\n",
-        (unsigned long) (image->columns+(image->columns % 2)));
+      (void) FormatMagickString(buffer,MaxTextExtent,"Width: %.20g\n",
+        (double) (image->columns+(image->columns % 2)));
       (void) WriteBlobString(image,buffer);
-      (void) FormatMagickString(buffer,MaxTextExtent,"Height: %lu\n",
-        (unsigned long) image->rows);
+      (void) FormatMagickString(buffer,MaxTextExtent,"Height: %.20g\n",
+        (double) image->rows);
       (void) WriteBlobString(image,buffer);
       (void) WriteBlobString(image,"\n");
     }
diff --git a/coders/cin.c b/coders/cin.c
index 22656e3..e9f055a 100644
--- a/coders/cin.c
+++ b/coders/cin.c
@@ -584,13 +584,13 @@
   cin.origination.x_offset=(ssize_t) ReadBlobLong(image);
   offset+=4;
   if ((size_t) cin.origination.x_offset != ~0UL)
-    (void) FormatImageProperty(image,"cin:origination.x_offset","%ld",
-      (long) cin.origination.x_offset);
+    (void) FormatImageProperty(image,"cin:origination.x_offset","%.20g",
+      (double) cin.origination.x_offset);
   cin.origination.y_offset=(ssize_t) ReadBlobLong(image);
   offset+=4;
   if ((size_t) cin.origination.y_offset != ~0UL)
-    (void) FormatImageProperty(image,"cin:origination.y_offset","%ld",
-      (long) cin.origination.y_offset);
+    (void) FormatImageProperty(image,"cin:origination.y_offset","%.20g",
+      (double) cin.origination.y_offset);
   offset+=ReadBlob(image,sizeof(cin.origination.filename),(unsigned char *)
     cin.origination.filename);
   (void) SetImageProperty(image,"cin:origination.filename",
@@ -647,7 +647,7 @@
       cin.film.prefix=ReadBlobLong(image);
       offset+=4;
       if (cin.film.prefix != ~0UL)
-        (void) FormatImageProperty(image,"cin:film.prefix","%lu",(unsigned long)
+        (void) FormatImageProperty(image,"cin:film.prefix","%.20g",(double)
           cin.film.prefix);
       cin.film.count=ReadBlobLong(image);
       offset+=4;
@@ -657,8 +657,8 @@
       cin.film.frame_position=ReadBlobLong(image);
       offset+=4;
       if (cin.film.frame_position != ~0UL)
-        (void) FormatImageProperty(image,"cin:film.frame_position","%lu",
-          (unsigned long) cin.film.frame_position);
+        (void) FormatImageProperty(image,"cin:film.frame_position","%.20g",
+          (double) cin.film.frame_position);
       cin.film.frame_rate=ReadBlobFloat(image);
       offset+=4;
       if (IsFloatDefined(cin.film.frame_rate) != MagickFalse)
diff --git a/coders/cip.c b/coders/cip.c
index ce7f973..318eb31 100644
--- a/coders/cip.c
+++ b/coders/cip.c
@@ -212,17 +212,17 @@
         basename);
     }
   (void) WriteBlobString(image,buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"<LocationX>%ld</LocationX>\n",
-    (long) image->page.x);
+  (void) FormatMagickString(buffer,MaxTextExtent,
+    "<LocationX>%.20g</LocationX>\n",(double) image->page.x);
   (void) WriteBlobString(image,buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"<LocationY>%ld</LocationY>\n",
-    (long) image->page.y);
+  (void) FormatMagickString(buffer,MaxTextExtent,
+    "<LocationY>%.20g</LocationY>\n",(double) image->page.y);
   (void) WriteBlobString(image,buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"<Width>%lu</Width>\n",
-    (unsigned long) (image->columns+(image->columns % 2)));
+  (void) FormatMagickString(buffer,MaxTextExtent,"<Width>%.20g</Width>\n",
+    (double) (image->columns+(image->columns % 2)));
   (void) WriteBlobString(image,buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"<Height>%lu</Height>\n",
-    (unsigned long) image->rows);
+  (void) FormatMagickString(buffer,MaxTextExtent,"<Height>%.20g</Height>\n",
+    (double) image->rows);
   (void) WriteBlobString(image,buffer);
   (void) FormatMagickString(buffer,MaxTextExtent,"<Depth>2</Depth>\n");
   (void) WriteBlobString(image,buffer);
diff --git a/coders/djvu.c b/coders/djvu.c
index 2ff2e07..ba0e508 100644
--- a/coders/djvu.c
+++ b/coders/djvu.c
@@ -659,7 +659,8 @@
                 /* is this useful? */
         }
 #if DEBUG
-        printf("now filling %ld x %ld\n", image->columns,image->rows);
+        printf("now filling %.20g x %.20g\n",(double) image->columns,(double)
+          image->rows);
 #endif
 
 
@@ -684,7 +685,8 @@
 
 
 #if DEBUG
-        printf("END: finished filling %ld x %ld\n", image->columns,image->rows);
+        printf("END: finished filling %.20g x %.20g\n",(double) image->columns,
+          (double) image->rows);
 #endif
 
         SyncImage(image);
diff --git a/coders/dpx.c b/coders/dpx.c
index 2e80260..c0f2f5c 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -900,18 +900,18 @@
       dpx.television.interlace=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.interlace != 0)
-        (void) FormatImageProperty(image,"dpx:television.interlace","%ld",
-          (long) dpx.television.interlace);
+        (void) FormatImageProperty(image,"dpx:television.interlace","%.20g",
+          (double) dpx.television.interlace);
       dpx.television.field_number=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.field_number != 0)
-        (void) FormatImageProperty(image,"dpx:television.field_number","%ld",
-          (long) dpx.television.field_number);
+        (void) FormatImageProperty(image,"dpx:television.field_number","%.20g",
+          (double) dpx.television.field_number);
       dpx.television.video_signal=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.video_signal != 0)
-        (void) FormatImageProperty(image,"dpx:television.video_signal","%ld",
-          (long) dpx.television.video_signal);
+        (void) FormatImageProperty(image,"dpx:television.video_signal","%.20g",
+          (double) dpx.television.video_signal);
       dpx.television.padding=(unsigned char) ReadBlobByte(image);
       offset++;
       if (dpx.television.padding != 0)
diff --git a/coders/html.c b/coders/html.c
index 9fee4d5..7bc6d40 100644
--- a/coders/html.c
+++ b/coders/html.c
@@ -340,9 +340,9 @@
       if (image->directory == (char *) NULL)
         {
           (void) FormatMagickString(buffer,MaxTextExtent,
-            "%s\" shape=\"rect\" coords=\"0,0,%lu,%lu\" alt=\"\" />\n",
-            image->filename,(unsigned long) geometry.width-1,(unsigned long)
-            geometry.height-1);
+            "%s\" shape=\"rect\" coords=\"0,0,%.20g,%.20g\" alt=\"\" />\n",
+            image->filename,(double) geometry.width-1,(double) geometry.height-
+            1);
           (void) WriteBlobString(image,buffer);
         }
       else
@@ -352,9 +352,9 @@
           else
             {
               (void) FormatMagickString(buffer,MaxTextExtent,
-                "\" shape=\"rect\" coords=\"%ld,%ld,%ld,%ld\" alt=\"\" />\n",
-                (long) geometry.x,(long) geometry.y,(long) (geometry.x+
-                geometry.width-1),(long) (geometry.y+geometry.height-1));
+                "\" shape=\"rect\" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
+                (double) geometry.x,(double) geometry.y,(double) (geometry.x+
+                geometry.width-1),(double) (geometry.y+geometry.height-1));
               (void) WriteBlobString(image,buffer);
               if (*(p+1) != '\0')
                 {
@@ -416,9 +416,8 @@
   if (image->directory == (char *) NULL)
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "%s\" shape=\"rect\" coords=\"0,0,%lu,%lu\" alt=\"\" />\n",
-        image->filename,(unsigned long) geometry.width-1,(unsigned long)
-        geometry.height-1);
+        "%s\" shape=\"rect\" coords=\"0,0,%.20g,%.20g\" alt=\"\" />\n",
+        image->filename,(double) geometry.width-1,(double) geometry.height-1);
       (void) WriteBlobString(image,buffer);
     }
   else
@@ -428,9 +427,9 @@
       else
         {
           (void) FormatMagickString(buffer,MaxTextExtent,
-            "\" shape=\"rect\" coords=\"%ld,%ld,%ld,%ld\" alt=\"\" />\n",
-            (long) geometry.x,(long) geometry.y,geometry.x+(long)
-            geometry.width-1,geometry.y+(long) geometry.height-1);
+            "\" shape=\"rect\" coords=\"%.20g,%.20g,%.20g,%.20g\" alt=\"\" />\n",
+            (double) geometry.x,(double) geometry.y,geometry.x+(double)
+            geometry.width-1,geometry.y+(double) geometry.height-1);
           (void) WriteBlobString(image,buffer);
           if (*(p+1) != '\0')
             {
diff --git a/coders/icon.c b/coders/icon.c
index cf55eaa..b37afa5 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -324,19 +324,19 @@
         if (image->debug != MagickFalse)
           {
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              " scene    = %lu",(unsigned long) i);
+              " scene    = %.20g",(double) i);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   size   = %lu",(unsigned long) icon_info.size);
+              "   size   = %.20g",(double) icon_info.size);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   width  = %lu",(unsigned long) icon_file.directory[i].width);
+              "   width  = %.20g",(double) icon_file.directory[i].width);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   height = %lu",(unsigned long) icon_file.directory[i].height);
+              "   height = %.20g",(double) icon_file.directory[i].height);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   colors = %lu",(unsigned long ) icon_info.number_colors);
+              "   colors = %.20g",(double ) icon_info.number_colors);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   planes = %lu",(unsigned long) icon_info.planes);
+              "   planes = %.20g",(double) icon_info.planes);
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "   bpp    = %lu",(unsigned long) icon_info.bits_per_pixel);
+              "   bpp    = %.20g",(double) icon_info.bits_per_pixel);
           }
       if ((icon_info.number_colors != 0) || (icon_info.bits_per_pixel <= 16))
         {
diff --git a/coders/ipl.c b/coders/ipl.c
index 758388a..1a0b834 100644
--- a/coders/ipl.c
+++ b/coders/ipl.c
@@ -314,7 +314,8 @@
       if (image->scene >= (image_info->scene+image_info->number_scenes-1))
         break;
 /*
-   printf("Length: %lu, Memory size: %lu\n", length,(size_t)(image->depth));
+   printf("Length: %.20g, Memory size: %.20g\n", (double) length,(double)
+     image->depth);
 */
      quantum_info=AcquireQuantumInfo(image_info,image);
      if (quantum_info == (QuantumInfo *) NULL)
@@ -325,8 +326,8 @@
      pixels=GetQuantumPixels(quantum_info); 
      if(image->columns != ipl_info.width){
 /*
-     printf("Columns not set correctly!  Wanted: %lu, got: %lu\n",
-       ipl_info.width, image->columns);
+     printf("Columns not set correctly!  Wanted: %.20g, got: %.20g\n",
+       (double) ipl_info.width, (double) image->columns);
 */
      }
 
diff --git a/coders/jp2.c b/coders/jp2.c
index a0ad25e..5e3afa3 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -614,7 +614,7 @@
           blob=(jas_stream_memobj_t *) icc_stream->obj_;
           if (image->debug != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "Profile: ICC, %lu bytes",(unsigned long) blob->len_);
+              "Profile: ICC, %.20g bytes",(double) blob->len_);
           profile=AcquireStringInfo(blob->len_);
           SetStringInfoDatum(profile,blob->buf_);
           icc_profile=(StringInfo *) GetImageProfile(image,"icc");
diff --git a/coders/jpeg.c b/coders/jpeg.c
index 8c62326..b2d768a 100644
--- a/coders/jpeg.c
+++ b/coders/jpeg.c
@@ -432,7 +432,7 @@
     }
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "Profile: ICC, %lu bytes",(unsigned long) length);
+      "Profile: ICC, %.20g bytes",(double) length);
   return(MagickTrue);
 }
 
@@ -528,7 +528,7 @@
     }
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "Profile: iptc, %lu bytes",(unsigned long) length);
+      "Profile: iptc, %.20g bytes",(double) length);
   return(MagickTrue);
 }
 
@@ -612,7 +612,7 @@
       image->filename);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "Profile: %s, %lu bytes",name,(unsigned long) length);
+      "Profile: %s, %.20g bytes",name,(double) length);
   return(MagickTrue);
 }
 
@@ -737,7 +737,7 @@
              image->quality=(size_t) i+1;
            if (image->debug != MagickFalse)
              (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-               "Quality: %ld (%s)",(long) i+1,(qvalue <= hash[i]) &&
+               "Quality: %.20g (%s)",(double) i+1,(qvalue <= hash[i]) &&
                (sum <= sums[i]) ? "exact" : "approximate");
            break;
          }
@@ -786,7 +786,7 @@
                image->quality=(size_t) i+1;
              if (image->debug != MagickFalse)
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                 "Quality: %ld (%s)",(long) i+1,(qvalue <= hash[i]) &&
+                 "Quality: %.20g (%s)",(double) i+1,(qvalue <= hash[i]) &&
                  (sum <= sums[i]) ? "exact" : "approximate");
              break;
            }
@@ -1014,8 +1014,8 @@
       jpeg_info.scale_denom=(unsigned int) scale_factor;
       jpeg_calc_output_dimensions(&jpeg_info);
       if (image->debug != MagickFalse)
-        (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Scale factor: %ld",
-          (long) scale_factor);
+        (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+          "Scale factor: %.20g",(double) scale_factor);
     }
   precision=(size_t) jpeg_info.data_precision;
 #if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED)
@@ -1127,7 +1127,7 @@
     }
   JPEGSetImageQuality(&jpeg_info,image);
   JPEGSetImageSamplingFactor(&jpeg_info,image);
-  (void) FormatMagickString(value,MaxTextExtent,"%ld",(long)
+  (void) FormatMagickString(value,MaxTextExtent,"%.20g",(double)
     jpeg_info.out_color_space);
   (void) SetImageProperty(image,"jpeg:colorspace",value);
   if (image_info->ping != MagickFalse)
@@ -1590,8 +1590,8 @@
         }
         xmp_profile=DestroyStringInfo(xmp_profile);
       }
-    (void) LogMagickEvent(CoderEvent,GetMagickModule(),"%s profile: %lu bytes",
-      name,(unsigned long) GetStringInfoLength(profile));
+    (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+      "%s profile: %.20g bytes",name,(double) GetStringInfoLength(profile));
     name=GetNextImageProfile(image);
   }
   custom_profile=DestroyStringInfo(custom_profile);
@@ -1780,8 +1780,8 @@
   jpeg_info.density_unit=(UINT8) 1;
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "Image resolution: %ld,%ld",(long) floor(image->x_resolution+0.5),
-      (long) floor(image->y_resolution+0.5));
+      "Image resolution: %.20g,%.20g",floor(image->x_resolution+0.5),
+      floor(image->y_resolution+0.5));
   if ((image->x_resolution != 0.0) && (image->y_resolution != 0.0))
     {
       /*
@@ -1919,8 +1919,8 @@
       else
         jpeg_set_quality(&jpeg_info,(int) image->quality,MagickTrue);
       if (image->debug != MagickFalse)
-        (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: %lu",
-          (unsigned long) image->quality);
+        (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Quality: %.20g",
+          (double) image->quality);
     }
   else
     {
@@ -2025,11 +2025,11 @@
       else
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "Storage class: DirectClass");
-      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Depth: %lu",
-        (unsigned long) image->depth);
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Depth: %.20g",
+        (double) image->depth);
       if (image->colors != 0)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "Number of colors: %lu",(unsigned long) image->colors);
+          "Number of colors: %.20g",(double) image->colors);
       else
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "Number of colors: unspecified");
diff --git a/coders/mat.c b/coders/mat.c
index eed591a..63ab294 100644
--- a/coders/mat.c
+++ b/coders/mat.c
@@ -749,7 +749,7 @@
     CellType = ReadBlobXXXLong(image2);    /* Additional object type */
     if (logging)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "MATLAB_HDR.CellType: %ld",(long) CellType);
+        "MATLAB_HDR.CellType: %.20g",(double) CellType);
   
     (void) ReadBlob(image2, 4, (unsigned char *) &size);     /* data size */
 
diff --git a/coders/miff.c b/coders/miff.c
index 27d78b1..53e74d9 100644
--- a/coders/miff.c
+++ b/coders/miff.c
@@ -1818,13 +1818,13 @@
     */
     (void) WriteBlobString(image,"id=ImageMagick  version=1.0\n");
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "class=%s  colors=%lu  matte=%s\n",MagickOptionToMnemonic(
-      MagickClassOptions,image->storage_class),(unsigned long) image->colors,
+      "class=%s  colors=%.20g  matte=%s\n",MagickOptionToMnemonic(
+      MagickClassOptions,image->storage_class),(double) image->colors,
       MagickOptionToMnemonic(MagickBooleanOptions,(ssize_t) image->matte));
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"columns=%lu  rows=%lu  "
-      "depth=%lu\n",(unsigned long) image->columns,(unsigned long) image->rows,
-      (unsigned long) image->depth);
+    (void) FormatMagickString(buffer,MaxTextExtent,"columns=%.20g  rows=%.20g  "
+      "depth=%.20g\n",(double) image->columns,(double) image->rows,(double)
+      image->depth);
     (void) WriteBlobString(image,buffer);
     if (image->type != UndefinedType)
       {
@@ -1841,8 +1841,8 @@
     if (compression != UndefinedCompression)
       {
         (void) FormatMagickString(buffer,MaxTextExtent,"compression=%s  "
-          "quality=%lu\n",MagickOptionToMnemonic(MagickCompressOptions,
-          compression),(unsigned long) image->quality);
+          "quality=%.20g\n",MagickOptionToMnemonic(MagickCompressOptions,
+          compression),(double) image->quality);
         (void) WriteBlobString(image,buffer);
       }
     if (image->units != UndefinedResolution)
@@ -1859,9 +1859,9 @@
       }
     if ((image->page.width != 0) || (image->page.height != 0))
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"page=%lux%lu%+ld%+ld\n",
-          (unsigned long) image->page.width,(unsigned long) image->page.height,
-          (long) image->page.x,(long) image->page.y);
+        (void) FormatMagickString(buffer,MaxTextExtent,
+          "page=%.20gx%.20g%+.20g%+.20g\n",(double) image->page.width,(double)
+          image->page.height,(double) image->page.x,(double) image->page.y);
         (void) WriteBlobString(image,buffer);
       }
     else
@@ -1881,41 +1881,40 @@
         (GetPreviousImageInList(image) != (Image *) NULL))
       {
         if (image->scene == 0)
-          (void) FormatMagickString(buffer,MaxTextExtent,"iterations=%lu  "
-            "delay=%lu  ticks-per-second=%lu\n",(unsigned long)
-             image->iterations,(unsigned long) image->delay,(unsigned long)
-             image->ticks_per_second);
+          (void) FormatMagickString(buffer,MaxTextExtent,"iterations=%.20g  "
+            "delay=%.20g  ticks-per-second=%.20g\n",(double) image->iterations,
+            (double) image->delay,(double) image->ticks_per_second);
         else
-          (void) FormatMagickString(buffer,MaxTextExtent,"scene=%lu  "
-            "iterations=%lu  delay=%lu  ticks-per-second=%lu\n",(unsigned long)
-            image->scene,(unsigned long) image->iterations,(unsigned long)
-            image->delay,(unsigned long) image->ticks_per_second);
+          (void) FormatMagickString(buffer,MaxTextExtent,"scene=%.20g  "
+            "iterations=%.20g  delay=%.20g  ticks-per-second=%.20g\n",(double)
+            image->scene,(double) image->iterations,(double) image->delay,
+            (double) image->ticks_per_second);
         (void) WriteBlobString(image,buffer);
       }
     else
       {
         if (image->scene != 0)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"scene=%lu\n",
-              (unsigned long) image->scene);
+            (void) FormatMagickString(buffer,MaxTextExtent,"scene=%.20g\n",
+              (double) image->scene);
             (void) WriteBlobString(image,buffer);
           }
         if (image->iterations != 0)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"iterations=%lu\n",
-              (unsigned long) image->iterations);
+            (void) FormatMagickString(buffer,MaxTextExtent,"iterations=%.20g\n",
+              (double) image->iterations);
             (void) WriteBlobString(image,buffer);
           }
         if (image->delay != 0)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"delay=%lu\n",
-              (unsigned long) image->delay);
+            (void) FormatMagickString(buffer,MaxTextExtent,"delay=%.20g\n",
+              (double) image->delay);
             (void) WriteBlobString(image,buffer);
           }
         if (image->ticks_per_second != UndefinedTicksPerSecond)
           {
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "ticks-per-second=%lu\n",(unsigned long) image->ticks_per_second);
+              "ticks-per-second=%.20g\n",(double) image->ticks_per_second);
             (void) WriteBlobString(image,buffer);
           }
       }
@@ -1986,8 +1985,9 @@
           profile=GetImageProfile(image,name);
           if (profile != (StringInfo *) NULL)
             {
-              (void) FormatMagickString(buffer,MaxTextExtent,"profile:%s=%lu\n",
-                name,(unsigned long) GetStringInfoLength(profile));
+              (void) FormatMagickString(buffer,MaxTextExtent,
+                "profile:%s=%.20g\n",name,(double)
+                GetStringInfoLength(profile));
               (void) WriteBlobString(image,buffer);
             }
           name=GetNextImageProfile(image);
diff --git a/coders/mpc.c b/coders/mpc.c
index 0d59278..2b5376c 100644
--- a/coders/mpc.c
+++ b/coders/mpc.c
@@ -1080,13 +1080,13 @@
       MAGICKCORE_QUANTUM_DEPTH);
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "class=%s  colors=%lu  matte=%s\n",MagickOptionToMnemonic(
-      MagickClassOptions,image->storage_class),(unsigned long) image->colors,
+      "class=%s  colors=%.20g  matte=%s\n",MagickOptionToMnemonic(
+      MagickClassOptions,image->storage_class),(double) image->colors,
       MagickOptionToMnemonic(MagickBooleanOptions,(ssize_t) image->matte));
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "columns=%lu  rows=%lu  depth=%lu\n",(unsigned long) image->columns,
-      (unsigned long) image->rows,(unsigned long) image->depth);
+      "columns=%.20g  rows=%.20g depth=%.20g\n",(double) image->columns,
+      (double) image->rows,(double) image->depth);
     (void) WriteBlobString(image,buffer);
     if (image->type != UndefinedType)
       {
@@ -1109,9 +1109,8 @@
     if (image->compression != UndefinedCompression)
       {
         (void) FormatMagickString(buffer,MaxTextExtent,
-          "compression=%s  quality=%lu\n",MagickOptionToMnemonic(
-          MagickCompressOptions,image->compression),(unsigned long)
-          image->quality);
+          "compression=%s  quality=%.20g\n",MagickOptionToMnemonic(
+          MagickCompressOptions,image->compression),(double) image->quality);
         (void) WriteBlobString(image,buffer);
       }
     if (image->units != UndefinedResolution)
@@ -1128,9 +1127,9 @@
       }
     if ((image->page.width != 0) || (image->page.height != 0))
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"page=%lux%lu%+ld%+ld\n",
-          (unsigned long) image->page.width,(unsigned long) image->page.height,
-          (long) image->page.x,(long) image->page.y);
+        (void) FormatMagickString(buffer,MaxTextExtent,
+          "page=%.20gx%.20g%+.20g%+.20g\n",(double) image->page.width,(double)
+          image->page.height,(double) image->page.x,(double) image->page.y);
         (void) WriteBlobString(image,buffer);
       }
     else
@@ -1151,40 +1150,40 @@
       {
         if (image->scene == 0)
           (void) FormatMagickString(buffer,MaxTextExtent,
-            "iterations=%lu  delay=%lu  ticks-per-second=%lu\n",(long)
-            image->iterations,(long) image->delay,(long)
+            "iterations=%.20g  delay=%.20g  ticks-per-second=%.20g\n",(double)
+            image->iterations,(double) image->delay,(double)
             image->ticks_per_second);
         else
           (void) FormatMagickString(buffer,MaxTextExtent,
-            "scene=%lu  iterations=%lu  delay=%lu  ticks-per-second=%lu\n",
-            (long) image->scene,(long) image->iterations,(long) image->delay,
-            (long) image->ticks_per_second);
+            "scene=%.20g  iterations=%.20g  delay=%.20g  ticks-per-second=%.20g\n",
+            (double) image->scene,(double) image->iterations,(double)
+            image->delay,(double) image->ticks_per_second);
         (void) WriteBlobString(image,buffer);
       }
     else
       {
         if (image->scene != 0)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"scene=%lu\n",
-              (unsigned long) image->scene);
+            (void) FormatMagickString(buffer,MaxTextExtent,"scene=%.20g\n",
+              (double) image->scene);
             (void) WriteBlobString(image,buffer);
           }
         if (image->iterations != 0)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"iterations=%lu\n",
-              (unsigned long) image->iterations);
+            (void) FormatMagickString(buffer,MaxTextExtent,"iterations=%.20g\n",
+              (double) image->iterations);
             (void) WriteBlobString(image,buffer);
           }
         if (image->delay != 0)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"delay=%lu\n",
-              (unsigned long) image->delay);
+            (void) FormatMagickString(buffer,MaxTextExtent,"delay=%.20g\n",
+              (double) image->delay);
             (void) WriteBlobString(image,buffer);
           }
         if (image->ticks_per_second != UndefinedTicksPerSecond)
           {
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "ticks-per-second=%lu\n",(unsigned long) image->ticks_per_second);
+              "ticks-per-second=%.20g\n",(double) image->ticks_per_second);
             (void) WriteBlobString(image,buffer);
           }
       }
@@ -1255,8 +1254,9 @@
           profile=GetImageProfile(image,name);
           if (profile != (StringInfo *) NULL)
             {
-              (void) FormatMagickString(buffer,MaxTextExtent,"profile:%s=%lu\n",
-                name,(unsigned long) GetStringInfoLength(profile));
+              (void) FormatMagickString(buffer,MaxTextExtent,
+                "profile:%s=%.20g\n",name,(double)
+                GetStringInfoLength(profile));
               (void) WriteBlobString(image,buffer);
             }
           name=GetNextImageProfile(image);
diff --git a/coders/mpeg.c b/coders/mpeg.c
index dffe606..4f489e0 100644
--- a/coders/mpeg.c
+++ b/coders/mpeg.c
@@ -539,12 +539,12 @@
           Image
             *frame;
 
-          (void) FormatMagickString(p->filename,MaxTextExtent,"%s%lu.%s",
-            basename,(unsigned long) p->scene,WriteMPEGIntermediateFormat);
-          (void) FormatMagickString(filename,MaxTextExtent,"%s%lu.%s",
-            basename,(unsigned long) p->scene,WriteMPEGIntermediateFormat);
+          (void) FormatMagickString(p->filename,MaxTextExtent,"%s%.20g.%s",
+            basename,(double) p->scene,WriteMPEGIntermediateFormat);
+          (void) FormatMagickString(filename,MaxTextExtent,"%s%.20g.%s",
+            basename,(double) p->scene,WriteMPEGIntermediateFormat);
           (void) FormatMagickString(previous_image,MaxTextExtent,
-            "%s%lu.%s",basename,(unsigned long) p->scene,
+            "%s%.20g.%s",basename,(double) p->scene,
             WriteMPEGIntermediateFormat);
           frame=CloneImage(p,0,0,MagickTrue,&p->exception);
           if (frame == (Image *) NULL)
@@ -560,8 +560,8 @@
         }
         default:
         {
-          (void) FormatMagickString(filename,MaxTextExtent,"%s%lu.%s",
-            basename,(unsigned long) p->scene,WriteMPEGIntermediateFormat);
+          (void) FormatMagickString(filename,MaxTextExtent,"%s%.20g.%s",
+            basename,(double) p->scene,WriteMPEGIntermediateFormat);
           if (length > 0)
             status=BlobToFile(filename,blob,length,&image->exception);
           break;
@@ -571,14 +571,13 @@
         {
           if (status != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "%lu. Wrote %s file for scene %lu:",(unsigned long) i,
-              WriteMPEGIntermediateFormat,(unsigned long) p->scene);
+              "%.20g. Wrote %s file for scene %.20g:",(double) i,
+              WriteMPEGIntermediateFormat,(double) p->scene);
           else
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "%lu. Failed to write %s file for scene %lu:",(unsigned long) i,
-              WriteMPEGIntermediateFormat,(unsigned long) p->scene);
-          (void) LogMagickEvent(CoderEvent,GetMagickModule(),"%s",
-            filename);
+              "%.20g. Failed to write %s file for scene %.20g:",(double) i,
+              WriteMPEGIntermediateFormat,(double) p->scene);
+          (void) LogMagickEvent(CoderEvent,GetMagickModule(),"%s",filename);
         }
     }
     p->scene=scene;
@@ -612,8 +611,8 @@
     delay=100.0*p->delay/MagickMax(1.0*p->ticks_per_second,1.0);
     for (i=0; i < (ssize_t) MagickMax((1.0*delay+1.0)/3.0,1.0); i++)
     {
-      (void) FormatMagickString(p->filename,MaxTextExtent,"%s%lu.%s",
-        basename,(unsigned long) count++,WriteMPEGIntermediateFormat);
+      (void) FormatMagickString(p->filename,MaxTextExtent,"%s%.20g.%s",
+        basename,(double) count++,WriteMPEGIntermediateFormat);
       (void) RelinquishUniqueFileResource(p->filename);
     }
     (void) CopyMagickString(p->filename,image_info->filename,MaxTextExtent);
diff --git a/coders/msl.c b/coders/msl.c
index 053d9e5..69542c6 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -1061,9 +1061,9 @@
                 }
               }
             }
-          (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
-            (unsigned long) geometry.width,(unsigned long) geometry.height,
-            (long) geometry.x,(long) geometry.y);
+          (void) FormatMagickString(text,MaxTextExtent,
+            "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+            geometry.height,(double) geometry.x,(double) geometry.y);
           CloneString(&draw_info->geometry,text);
           draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
           draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
@@ -2040,8 +2040,8 @@
             }
           image=msl_info->image[n];
           (void) FormatMagickString(composite_geometry,MaxTextExtent,
-            "%lux%lu%+ld%+ld",(unsigned long) composite_image->columns,
-            (unsigned long) composite_image->rows,(long) geometry.x,(long)
+            "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,
+            (double) composite_image->rows,(double) geometry.x,(double)
             geometry.y);
           flags=ParseGravityGeometry(image,composite_geometry,&geometry,
             &exception);
@@ -2651,9 +2651,9 @@
                 }
               }
             }
-          (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
-            (unsigned long) geometry.width,(unsigned long) geometry.height,
-            (long) geometry.x,(long) geometry.y);
+          (void) FormatMagickString(text,MaxTextExtent,
+            "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+            geometry.height,(double) geometry.x,(double) geometry.y);
           CloneString(&draw_info->geometry,text);
           draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
           draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
@@ -3265,8 +3265,8 @@
               {
                 if (LocaleCompare(keyword,"height") == 0)
                   {
-                    (void) FormatMagickString(value,MaxTextExtent,"%lu",
-                      (unsigned long) msl_info->image[n]->rows);
+                    (void) FormatMagickString(value,MaxTextExtent,"%.20g",
+                      (double) msl_info->image[n]->rows);
                     (void) SetImageProperty(msl_info->attributes[n],key,value);
                     break;
                   }
@@ -3277,8 +3277,8 @@
               {
                 if (LocaleCompare(keyword,"width") == 0)
                   {
-                    (void) FormatMagickString(value,MaxTextExtent,"%lu",
-                      (unsigned long) msl_info->image[n]->columns);
+                    (void) FormatMagickString(value,MaxTextExtent,"%.20g",
+                      (double) msl_info->image[n]->columns);
                     (void) SetImageProperty(msl_info->attributes[n],key,value);
                     break;
                   }
@@ -4794,9 +4794,9 @@
                 }
               }
             }
-          (void) FormatMagickString(text,MaxTextExtent,"%lux%lu%+ld%+ld",
-            (unsigned long) geometry.width,(unsigned long) geometry.height,
-            (long) geometry.x,(long) geometry.y);
+          (void) FormatMagickString(text,MaxTextExtent,
+            "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,(double)
+            geometry.height,(double) geometry.x,(double) geometry.y);
           CloneString(&draw_info->geometry,text);
           draw_info->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
           draw_info->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
@@ -6048,13 +6048,12 @@
                 if (image_option != (const char *) NULL)
                   flags=ParseAbsoluteGeometry(image_option,&geometry);
                 flags=ParseAbsoluteGeometry(value,&geometry);
-                (void) FormatMagickString(page,MaxTextExtent,"%lux%lu",
-                  (unsigned long) geometry.width,(unsigned long)
-                  geometry.height);
+                (void) FormatMagickString(page,MaxTextExtent,"%.20gx%.20g",
+                  (double) geometry.width,(double) geometry.height);
                 if (((flags & XValue) != 0) || ((flags & YValue) != 0))
                   (void) FormatMagickString(page,MaxTextExtent,
-                    "%lux%lu%+ld%+ld",(unsigned long) geometry.width,
-                    (unsigned long) geometry.height,(long) geometry.x,(long)
+                    "%.20gx%.20g%+.20g%+.20g",(double) geometry.width,
+                    (double) geometry.height,(double) geometry.x,(double)
                     geometry.y);
                 (void) SetImageOption(msl_info->image_info[n],keyword,page);
                 msl_info->image_info[n]->page=GetPageGeometry(page);
diff --git a/coders/mtv.c b/coders/mtv.c
index a9e3cff..72a2909 100644
--- a/coders/mtv.c
+++ b/coders/mtv.c
@@ -369,8 +369,8 @@
     /*
       Initialize raster file header.
     */
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n",
-      (unsigned long) image->columns,(unsigned long) image->rows);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n",(double)
+      image->columns,(double) image->rows);
     (void) WriteBlobString(image,buffer);
     for (y=0; y < (ssize_t) image->rows; y++)
     {
diff --git a/coders/pcl.c b/coders/pcl.c
index 858d994..2c6427e 100644
--- a/coders/pcl.c
+++ b/coders/pcl.c
@@ -305,8 +305,8 @@
     (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
   if (image_info->page != (char *) NULL)
     (void) ParseAbsoluteGeometry(image_info->page,&page);
-  (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu",
-    (unsigned long) page.width,(unsigned long) page.height);
+  (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
+    page.width,(double) page.height);
   if (image_info->monochrome != MagickFalse)
     delegate_info=GetDelegateInfo("pcl:mono",(char *) NULL,exception);
   else
@@ -326,20 +326,20 @@
   page.width=(size_t) floor(page.width*image->x_resolution/delta.x+0.5);
   page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
     0.5);
-  (void) FormatMagickString(options,MaxTextExtent,"-g%lux%lu ",
-    (unsigned long) page.width,(unsigned long) page.height);
+  (void) FormatMagickString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
+     page.width,(double) page.height);
   image=DestroyImage(image);
   read_info=CloneImageInfo(image_info);
   *read_info->magick='\0';
   if (read_info->number_scenes != 0)
     {
       if (read_info->number_scenes != 1)
-        (void) FormatMagickString(options,MaxTextExtent,"-dLastPage=%lu",
-          (unsigned long) (read_info->scene+read_info->number_scenes));
+        (void) FormatMagickString(options,MaxTextExtent,"-dLastPage=%.20g",
+          (double) (read_info->scene+read_info->number_scenes));
       else
         (void) FormatMagickString(options,MaxTextExtent,
-          "-dFirstPage=%lu -dLastPage=%lu",(unsigned long) read_info->scene+1,
-          (unsigned long) (read_info->scene+read_info->number_scenes));
+          "-dFirstPage=%.20g -dLastPage=%.20g",(double) read_info->scene+1,
+          (double) (read_info->scene+read_info->number_scenes));
       read_info->number_scenes=0;
       if (read_info->scenes != (char *) NULL)
         *read_info->scenes='\0';
@@ -721,10 +721,11 @@
     */
     (void) WriteBlobString(image,"\033E");  /* printer reset */
     (void) WriteBlobString(image,"\033*r3F");  /* set presentation mode */
-    (void) FormatMagickString(buffer,MaxTextExtent,"\033*r%lus%luT",
-      (unsigned long) image->columns,(unsigned long) image->rows);
+    (void) FormatMagickString(buffer,MaxTextExtent,"\033*r%.20gs%.20gT",
+      (double) image->columns,(double) image->rows);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"\033*t%ldR",(long) density);
+    (void) FormatMagickString(buffer,MaxTextExtent,"\033*t%.20gR",(double)
+      density);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"\033&l0E");  /* top margin 0 */
     if (IsMonochromeImage(image,&image->exception) != MagickFalse)
@@ -776,15 +777,16 @@
           for (i=0; i < (ssize_t) image->colors; i++)
           {
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "\033*v%da%db%dc%ldI",ScaleQuantumToChar(image->colormap[i].red),
+              "\033*v%da%db%dc%.20gI",
+              ScaleQuantumToChar(image->colormap[i].red),
               ScaleQuantumToChar(image->colormap[i].green),
-              ScaleQuantumToChar(image->colormap[i].blue),(long) i);
+              ScaleQuantumToChar(image->colormap[i].blue),(double) i);
             (void) WriteBlobString(image,buffer);
           }
           for ( ; i < (1L << bits_per_pixel); i++)
           {
-            (void) FormatMagickString(buffer,MaxTextExtent,"\033*v%luI",
-              (unsigned long) i);
+            (void) FormatMagickString(buffer,MaxTextExtent,"\033*v%.20gI",
+              (double) i);
             (void) WriteBlobString(image,buffer);
           }
         }
@@ -912,8 +914,8 @@
       {
         case NoCompression:
         {
-          (void) FormatMagickString(buffer,MaxTextExtent,"\033*b%luW",
-            (unsigned long) length);
+          (void) FormatMagickString(buffer,MaxTextExtent,"\033*b%.20gW",
+            (double) length);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,length,pixels);
           break;
@@ -922,8 +924,8 @@
         {
           packets=PCLPackbitsCompressImage(length,pixels,
             compress_pixels);
-          (void) FormatMagickString(buffer,MaxTextExtent,"\033*b%luW",
-            (unsigned long) packets);
+          (void) FormatMagickString(buffer,MaxTextExtent,"\033*b%.20gW",
+            (double) packets);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,packets,compress_pixels);
           break;
@@ -935,8 +937,8 @@
               previous_pixels[i]=(~pixels[i]);
           packets=PCLDeltaCompressImage(length,previous_pixels,pixels,
             compress_pixels);
-          (void) FormatMagickString(buffer,MaxTextExtent,"\033*b%luW",
-            (unsigned long) packets);
+          (void) FormatMagickString(buffer,MaxTextExtent,"\033*b%.20gW",
+            (double) packets);
           (void) WriteBlobString(image,buffer);
           (void) WriteBlob(image,packets,compress_pixels);
           (void) CopyMagickMemory(previous_pixels,pixels,length*
diff --git a/coders/pdf.c b/coders/pdf.c
index b13bf2d..5e4ad82 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -456,8 +456,8 @@
         /*
           Note spot names.
         */
-        (void) FormatMagickString(property,MaxTextExtent,"pdf:SpotColor-%lu",
-          (unsigned long) spotcolor++);
+        (void) FormatMagickString(property,MaxTextExtent,"pdf:SpotColor-%.20g",
+          (double) spotcolor++);
         i=0;
         for (c=ReadBlobByte(image); c != EOF; c=ReadBlobByte(image))
         {
@@ -596,8 +596,8 @@
         0.5);
       page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
         0.5);
-      (void) FormatMagickString(options,MaxTextExtent,"-g%lux%lu ",
-        (unsigned long) page.width,(unsigned long) page.height);
+      (void) FormatMagickString(options,MaxTextExtent,"-g%.20gx%.20g ",
+        (double) page.width,(double) page.height);
     }
   if (cmyk != MagickFalse)
     (void) ConcatenateMagickString(options,"-dUseCIEColor ",MaxTextExtent);
@@ -612,8 +612,8 @@
       char
         pages[MaxTextExtent];
 
-      (void) FormatMagickString(pages,MaxTextExtent,"-dFirstPage=%lu "
-        "-dLastPage=%lu",(unsigned long) read_info->scene+1,(unsigned long)
+      (void) FormatMagickString(pages,MaxTextExtent,"-dFirstPage=%.20g "
+        "-dLastPage=%.20g",(double) read_info->scene+1,(double)
         (read_info->scene+read_info->number_scenes));
       (void) ConcatenateMagickString(options,pages,MaxTextExtent);
       read_info->number_scenes=0;
@@ -1055,8 +1055,8 @@
       version=(size_t) MagickMax(version,4);
   if (LocaleCompare(image_info->magick,"PDFA") == 0)
     version=(size_t) MagickMax(version,6);
-  (void) FormatMagickString(buffer,MaxTextExtent,"%%PDF-1.%lu \n",
-    (unsigned long) version);
+  (void) FormatMagickString(buffer,MaxTextExtent,"%%PDF-1.%.20g \n",
+    (double) version);
   (void) WriteBlobString(image,buffer);
   if (LocaleCompare(image_info->magick,"PDFA") == 0)
     (void) WriteBlobString(image,"%âãÏÓ\n");
@@ -1065,20 +1065,20 @@
   */
   xref[object++]=TellBlob(image);
   root_id=object;
-  (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",
-    (unsigned long) object);
+  (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
+    object);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"<<\n");
   if (LocaleCompare(image_info->magick,"PDFA") != 0)
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Pages %lu 0 R\n",
-      (unsigned long) object+1);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Pages %.20g 0 R\n",
+      (double) object+1);
   else
     {
-      (void) FormatMagickString(buffer,MaxTextExtent,"/Metadata %lu 0 R\n",
-        (unsigned long) object+1);
+      (void) FormatMagickString(buffer,MaxTextExtent,"/Metadata %.20g 0 R\n",
+        (double) object+1);
       (void) WriteBlobString(image,buffer);
-      (void) FormatMagickString(buffer,MaxTextExtent,"/Pages %lu 0 R\n",
-        (unsigned long) object+2);
+      (void) FormatMagickString(buffer,MaxTextExtent,"/Pages %.20g 0 R\n",
+        (double) object+2);
     }
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/Type /Catalog\n");
@@ -1099,8 +1099,8 @@
         Write XMP object.
       */
       xref[object++]=TellBlob(image);
-      (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",
-        (unsigned long) object);
+      (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",
+        (double) object);
       (void) WriteBlobString(image,buffer);
       (void) WriteBlobString(image,"<<\n");
       (void) WriteBlobString(image,"/Subtype /XML\n");
@@ -1116,7 +1116,8 @@
       i=FormatMagickString(xmp_profile,MaxTextExtent,XMPProfile,
         XMPProfileMagick,modify_date,create_date,timestamp,
         GetMagickVersion(&version),GetMagickVersion(&version));
-      (void) FormatMagickString(buffer,MaxTextExtent,"/Length %lu\n",1UL*i);
+      (void) FormatMagickString(buffer,MaxTextExtent,"/Length %.20g\n",
+        (double) i);
       (void) WriteBlobString(image,buffer);
       (void) WriteBlobString(image,"/Type /Metadata\n");
       (void) WriteBlobString(image,">>\nstream\n");
@@ -1129,13 +1130,13 @@
   */
   xref[object++]=TellBlob(image);
   pages_id=object;
-  (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+  (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
     object);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"<<\n");
   (void) WriteBlobString(image,"/Type /Pages\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"/Kids [ %lu 0 R ",
-    (unsigned long) object+1);
+  (void) FormatMagickString(buffer,MaxTextExtent,"/Kids [ %.20g 0 R ",
+    (double) object+1);
   (void) WriteBlobString(image,buffer);
   count=(ssize_t) (pages_id+ObjectsPerImage+1);
   if (image_info->adjoin != MagickFalse)
@@ -1149,7 +1150,8 @@
       kid_image=image;
       for ( ; GetNextImageInList(kid_image) != (Image *) NULL; count+=ObjectsPerImage)
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"%ld 0 R ",(long) count);
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 R ",(double)
+          count);
         (void) WriteBlobString(image,buffer);
         kid_image=GetNextImageInList(kid_image);
       }
@@ -1159,8 +1161,8 @@
         ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
     }
   (void) WriteBlobString(image,"]\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"/Count %lu\n",
-    (unsigned long) ((count-pages_id)/ObjectsPerImage));
+  (void) FormatMagickString(buffer,MaxTextExtent,"/Count %.20g\n",
+    (double) ((count-pages_id)/ObjectsPerImage));
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,">>\n");
   (void) WriteBlobString(image,"endobj\n");
@@ -1259,15 +1261,16 @@
         resolution.y=(size_t) (100.0*2.54*resolution.y+0.5)/100.0;
       }
     SetGeometry(image,&geometry);
-    (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
-      (unsigned long) image->columns,(unsigned long) image->rows);
+    (void) FormatMagickString(page_geometry,MaxTextExtent,"%.20gx%.20g",
+      (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MaxTextExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
-        (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
-          (unsigned long) image->page.width,(unsigned long) image->page.height,
-          (long) image->page.x,(long) image->page.y);
+        (void) FormatMagickString(page_geometry,MaxTextExtent,
+          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,
+          (double) image->page.height,(double) image->page.x,(double)
+          image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
             (LocaleCompare(image_info->magick,"PDF") == 0))
@@ -1298,13 +1301,13 @@
       Write Page object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
     (void) WriteBlobString(image,"/Type /Page\n");
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Parent %lu 0 R\n",
-      (unsigned long) pages_id);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Parent %.20g 0 R\n",
+      (double) pages_id);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"/Resources <<\n");
     labels=(char **) NULL;
@@ -1314,16 +1317,16 @@
     if (labels != (char **) NULL)
       {
         (void) FormatMagickString(buffer,MaxTextExtent,
-          "/Font << /F%lu %lu 0 R >>\n",(unsigned long) image->scene,
-          (unsigned long) object+4);
+          "/Font << /F%.20g %.20g 0 R >>\n",(double) image->scene,(double)
+          object+4);
         (void) WriteBlobString(image,buffer);
       }
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "/XObject << /Im%lu %lu 0 R >>\n",(unsigned long) image->scene,
-      (unsigned long) object+5);
+      "/XObject << /Im%.20g %.20g 0 R >>\n",(double) image->scene,(double)
+      object+5);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/ProcSet %lu 0 R >>\n",
-      (unsigned long) object+3);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/ProcSet %.20g 0 R >>\n",
+      (double) object+3);
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,
       "/MediaBox [0 0 %g %g]\n",72.0*media_info.width/resolution.x,
@@ -1333,11 +1336,11 @@
       "/CropBox [0 0 %g %g]\n",72.0*media_info.width/resolution.x,
       72.0*media_info.height/resolution.y);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Contents %lu 0 R\n",
-      (unsigned long) object+1);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Contents %.20g 0 R\n",
+      (double) object+1);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Thumb %lu 0 R\n",
-      (unsigned long) object+8);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Thumb %.20g 0 R\n",
+      (double) object+8);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
     (void) WriteBlobString(image,"endobj\n");
@@ -1345,12 +1348,12 @@
       Write Contents object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Length %lu 0 R\n",
-      (unsigned long) object+1);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Length %.20g 0 R\n",
+      (double) object+1);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
     (void) WriteBlobString(image,"stream\n");
@@ -1360,22 +1363,23 @@
       for (i=0; labels[i] != (char *) NULL; i++)
       {
         (void) WriteBlobString(image,"BT\n");
-        (void) FormatMagickString(buffer,MaxTextExtent,"/F%lu %g Tf\n",
-          (unsigned long) image->scene,pointsize);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/F%.20g %g Tf\n",
+          (double) image->scene,pointsize);
         (void) WriteBlobString(image,buffer);
-        (void) FormatMagickString(buffer,MaxTextExtent,"%ld %ld Td\n",(long)
-          geometry.x,(long) (geometry.y+geometry.height+i*pointsize+12));
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g Td\n",
+          (double) geometry.x,(double) (geometry.y+geometry.height+i*pointsize+
+          12));
         (void) WriteBlobString(image,buffer);
         (void) FormatMagickString(buffer,MaxTextExtent,"(%s) Tj\n",labels[i]);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"ET\n");
         labels[i]=DestroyString(labels[i]);
       }
-    (void) FormatMagickString(buffer,MaxTextExtent,"%g 0 0 %g %ld %ld cm\n",
-      scale.x,scale.y,(long) geometry.x,(long) geometry.y);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%g 0 0 %g %.20g %.20g cm\n",
+      scale.x,scale.y,(double) geometry.x,(double) geometry.y);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Im%lu Do\n",
-      (unsigned long) image->scene);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Im%.20g Do\n",
+      (double) image->scene);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"Q\n");
     offset=TellBlob(image)-offset;
@@ -1385,19 +1389,18 @@
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",
-      (unsigned long) offset);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double) offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
     /*
       Write Procset object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",
-      (unsigned long) object);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",
+      (double) object);
     (void) WriteBlobString(image,buffer);
     if ((image->storage_class == DirectClass) || (image->colors > 256))
       (void) CopyMagickString(buffer,"[ /PDF /Text /ImageC",MaxTextExtent);
@@ -1413,16 +1416,16 @@
       Write Font object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",
-      (unsigned long) object);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",
+      (double) object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
     if (labels != (char **) NULL)
       {
         (void) WriteBlobString(image,"/Type /Font\n");
         (void) WriteBlobString(image,"/Subtype /Type1\n");
-        (void) FormatMagickString(buffer,MaxTextExtent,"/Name /F%lu\n",
-          (unsigned long) image->scene);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/Name /F%.20g\n",
+          (double) image->scene);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"/BaseFont /Helvetica\n");
         (void) WriteBlobString(image,"/Encoding /MacRomanEncoding\n");
@@ -1434,14 +1437,14 @@
       Write XObject object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
     (void) WriteBlobString(image,"/Type /XObject\n");
     (void) WriteBlobString(image,"/Subtype /Image\n");
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Name /Im%lu\n",
-      (unsigned long) image->scene);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Name /Im%.20g\n",
+      (double) image->scene);
     (void) WriteBlobString(image,buffer);
     switch (compression)
     {
@@ -1487,8 +1490,8 @@
           MaxTextExtent);
         (void) WriteBlobString(image,buffer);
         (void) FormatMagickString(buffer,MaxTextExtent,"/DecodeParms [ << "
-          "/K %s /BlackIs1 false /Columns %ld /Rows %ld >> ]\n",CCITTParam,
-          (unsigned long) image->columns,(unsigned long) image->rows);
+          "/K %s /BlackIs1 false /Columns %.20g /Rows %.20g >> ]\n",CCITTParam,
+          (double) image->columns,(double) image->rows);
         break;
       }
       default:
@@ -1499,14 +1502,14 @@
       }
     }
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Width %lu\n",
-      (unsigned long) image->columns);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Width %.20g\n",(double)
+      image->columns);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Height %lu\n",
-      (unsigned long) image->rows);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Height %.20g\n",(double)
+      image->rows);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/ColorSpace %lu 0 R\n",
-      (unsigned long) object+2);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/ColorSpace %.20g 0 R\n",
+      (double) object+2);
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,"/BitsPerComponent %d\n",
       (compression == FaxCompression) || (compression == Group4Compression) ?
@@ -1514,12 +1517,12 @@
     (void) WriteBlobString(image,buffer);
     if (image->matte != MagickFalse)
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"/SMask %lu 0 R\n",
-          (unsigned long) object+7);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/SMask %.20g 0 R\n",
+          (double) object+7);
         (void) WriteBlobString(image,buffer);
       }
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Length %lu 0 R\n",
-      (unsigned long) object+1);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Length %.20g 0 R\n",
+      (double) object+1);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
     (void) WriteBlobString(image,"stream\n");
@@ -1847,18 +1850,18 @@
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",
-      (unsigned long) offset);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",
+      (double) offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
     /*
       Write Colorspace object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     if (image->colorspace == CMYKColorspace)
@@ -1876,8 +1879,8 @@
           (void) CopyMagickString(buffer,"/DeviceRGB\n",MaxTextExtent);
         else
           (void) FormatMagickString(buffer,MaxTextExtent,
-            "[ /Indexed /DeviceRGB %lu %lu 0 R ]\n",(unsigned long)
-            image->colors-1,(unsigned long) object+3);
+            "[ /Indexed /DeviceRGB %.20g %.20g 0 R ]\n",(double) image->colors-
+            1,(double) object+3);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
     /*
@@ -1891,7 +1894,7 @@
     if (tile_image == (Image *) NULL)
       ThrowWriterException(ResourceLimitError,image->exception.reason);
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
@@ -1939,8 +1942,8 @@
           MaxTextExtent);
         (void) WriteBlobString(image,buffer);
         (void) FormatMagickString(buffer,MaxTextExtent,"/DecodeParms [ << "
-          "/K %s /BlackIs1 false /Columns %lu /Rows %lu >> ]\n",CCITTParam,
-          (unsigned long) tile_image->columns,(unsigned long) tile_image->rows);
+          "/K %s /BlackIs1 false /Columns %.20g /Rows %.20g >> ]\n",CCITTParam,
+          (double) tile_image->columns,(double) tile_image->rows);
         break;
       }
       default:
@@ -1951,21 +1954,21 @@
       }
     }
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Width %lu\n",
-      (unsigned long) tile_image->columns);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Width %.20g\n",(double)
+      tile_image->columns);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Height %lu\n",
-      (unsigned long) tile_image->rows);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Height %.20g\n",(double)
+      tile_image->rows);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/ColorSpace %lu 0 R\n",
-      (unsigned long) object-1);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/ColorSpace %.20g 0 R\n",
+      (double) object-1);
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,"/BitsPerComponent %d\n",
       (compression == FaxCompression) || (compression == Group4Compression) ?
       1 : 8);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"/Length %lu 0 R\n",
-      (unsigned long) object+1);
+    (void) FormatMagickString(buffer,MaxTextExtent,"/Length %.20g 0 R\n",
+      (double) object+1);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,">>\n");
     (void) WriteBlobString(image,"stream\n");
@@ -2262,15 +2265,14 @@
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",
-      (unsigned long) offset);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double) offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     if ((image->storage_class != DirectClass) && (image->colors <= 256) &&
@@ -2282,8 +2284,8 @@
         (void) WriteBlobString(image,"<<\n");
         if (compression == NoCompression)
           (void) WriteBlobString(image,"/Filter [ /ASCII85Decode ]\n");
-        (void) FormatMagickString(buffer,MaxTextExtent,"/Length %lu 0 R\n",
-          (unsigned long) object+1);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/Length %.20g 0 R\n",
+          (double) object+1);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,">>\n");
         (void) WriteBlobString(image,"stream\n");
@@ -2316,10 +2318,10 @@
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double)
       offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
@@ -2327,7 +2329,7 @@
       Write softmask object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
@@ -2337,8 +2339,8 @@
       {
         (void) WriteBlobString(image,"/Type /XObject\n");
         (void) WriteBlobString(image,"/Subtype /Image\n");
-        (void) FormatMagickString(buffer,MaxTextExtent,"/Name /Ma%lu\n",
-          (unsigned long) image->scene);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/Name /Ma%.20g\n",
+          (double) image->scene);
         (void) WriteBlobString(image,buffer);
         switch (compression)
         {
@@ -2367,19 +2369,19 @@
           }
         }
         (void) WriteBlobString(image,buffer);
-        (void) FormatMagickString(buffer,MaxTextExtent,"/Width %lu\n",
-          (unsigned long) image->columns);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/Width %.20g\n",
+          (double) image->columns);
         (void) WriteBlobString(image,buffer);
-        (void) FormatMagickString(buffer,MaxTextExtent,"/Height %lu\n",
-          (unsigned long) image->rows);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/Height %.20g\n",
+          (double) image->rows);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"/ColorSpace /DeviceGray\n");
         (void) FormatMagickString(buffer,MaxTextExtent,"/BitsPerComponent %d\n",
           (compression == FaxCompression) || (compression == Group4Compression)
           ? 1 : 8);
         (void) WriteBlobString(image,buffer);
-        (void) FormatMagickString(buffer,MaxTextExtent,"/Length %lu 0 R\n",
-          (unsigned long) object+1);
+        (void) FormatMagickString(buffer,MaxTextExtent,"/Length %.20g 0 R\n",
+          (double) object+1);
         (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,">>\n");
         (void) WriteBlobString(image,"stream\n");
@@ -2466,11 +2468,10 @@
       Write Length object.
     */
     xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
       object);
     (void) WriteBlobString(image,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",(unsigned long)
-      offset);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double) offset);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"endobj\n");
     if (GetNextImageInList(image) == (Image *) NULL)
@@ -2486,7 +2487,7 @@
   */
   xref[object++]=TellBlob(image);
   info_id=object;
-  (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",(unsigned long)
+  (void) FormatMagickString(buffer,MaxTextExtent,"%.20g 0 obj\n",(double)
     object);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"<<\n");
@@ -2516,7 +2517,7 @@
   */
   offset=TellBlob(image)-xref[0]+10;
   (void) WriteBlobString(image,"xref\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"0 %lu\n",(unsigned long)
+  (void) FormatMagickString(buffer,MaxTextExtent,"0 %.20g\n",(double)
     object+1);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"0000000000 65535 f \n");
@@ -2528,19 +2529,18 @@
   }
   (void) WriteBlobString(image,"trailer\n");
   (void) WriteBlobString(image,"<<\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"/Size %lu\n",(unsigned long)
+  (void) FormatMagickString(buffer,MaxTextExtent,"/Size %.20g\n",(double)
     object+1);
   (void) WriteBlobString(image,buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"/Info %lu 0 R\n",
-    (unsigned long) info_id);
+  (void) FormatMagickString(buffer,MaxTextExtent,"/Info %.20g 0 R\n",(double)
+    info_id);
   (void) WriteBlobString(image,buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"/Root %lu 0 R\n",
-    (unsigned long) root_id);
+  (void) FormatMagickString(buffer,MaxTextExtent,"/Root %.20g 0 R\n",(double)
+    root_id);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,">>\n");
   (void) WriteBlobString(image,"startxref\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",
-    (unsigned long) offset);
+  (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double) offset);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"%%EOF\n");
   xref=(MagickOffsetType *) RelinquishMagickMemory(xref);
diff --git a/coders/pict.c b/coders/pict.c
index a42b87c..22d8b6e 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -1380,9 +1380,9 @@
         read_info=DestroyImageInfo(read_info);
         if (tile_image == (Image *) NULL)
           continue;
-        (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu",
-          (unsigned long) MagickMax(image->columns,tile_image->columns),
-          (unsigned long) MagickMax(image->rows,tile_image->rows));
+        (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g",
+          (double) MagickMax(image->columns,tile_image->columns),
+          (double) MagickMax(image->rows,tile_image->rows));
         (void) SetImageExtent(image,
           MagickMax(image->columns,tile_image->columns),
           MagickMax(image->rows,tile_image->rows));
diff --git a/coders/png.c b/coders/png.c
index 0ba7856..6e25765 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -549,8 +549,8 @@
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "    CompressColorMapTransFirst %s (%lu colors)",image->filename,
-      (unsigned long) image->colors);
+      "    CompressColorMapTransFirst %s (%.20g colors)",image->filename,
+      (double) image->colors);
   if (image->storage_class != PseudoClass || image->colors > 256 ||
       image->colors < 2)
     {
@@ -1055,8 +1055,8 @@
 {
   if (logging != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  Writing %c%c%c%c chunk, length: %lu",
-      type[0],type[1],type[2],type[3],(unsigned long) length);
+      "  Writing %c%c%c%c chunk, length: %.20g",
+      type[0],type[1],type[2],type[3],(double) length);
 }
 #endif /* PNG_LIBPNG_VER > 10011 */
 
@@ -1178,8 +1178,8 @@
             msg[MaxTextExtent];
 
           (void) FormatMagickString(msg,MaxTextExtent,
-            "Expected %lu bytes; found %lu bytes",(unsigned long) length,
-            (unsigned long) check);
+            "Expected %.20g bytes; found %.20g bytes",(double) length,
+            (double) check);
           png_warning(png_ptr,msg);
           png_error(png_ptr,"Read Exception");
         }
@@ -1894,8 +1894,8 @@
   if (logging != MagickFalse)
     {
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    PNG width: %lu, height: %lu",
-        (unsigned long) ping_width, (unsigned long) ping_height);
+        "    PNG width: %.20g, height: %.20g",
+        (double) ping_width, (double) ping_height);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "    PNG color_type: %d, bit_depth: %d",
         ping_color_type, ping_bit_depth);
@@ -2015,8 +2015,8 @@
       if (logging != MagickFalse)
         if (image->page.x || image->page.y)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "    Reading PNG oFFs chunk: x: %ld, y: %ld.",(long) image->page.x,
-            (long) image->page.y);
+            "    Reading PNG oFFs chunk: x: %.20g, y: %.20g.",(double)
+            image->page.x,(double) image->page.y);
     }
 #endif
 #if defined(PNG_pHYs_SUPPORTED)
@@ -2055,8 +2055,8 @@
         }
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    Reading PNG pHYs chunk: xres: %lu, yres: %lu, units: %d.",
-          (unsigned long) x_resolution,(unsigned long) y_resolution,unit_type);
+          "    Reading PNG pHYs chunk: xres: %.20g, yres: %.20g, units: %d.",
+          (double) x_resolution,(double) y_resolution,unit_type);
     }
 #endif
   if (png_get_valid(ping,ping_info,PNG_INFO_PLTE))
@@ -2180,9 +2180,10 @@
 
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "    image->background_color=(%d,%d,%d).",
-              image->background_color.red,
-              image->background_color.green,image->background_color.blue);
+              "    image->background_color=(%.20g,%.20g,%.20g).",
+              (double) image->background_color.red,
+              (double) image->background_color.green,
+              (double) image->background_color.blue);
         }
     }
 #endif
@@ -2349,7 +2350,7 @@
     {
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    Skipping PNG image data for scene %ld",(long)
+          "    Skipping PNG image data for scene %.20g",(double)
           mng_info->scenes_found-1);
       png_destroy_read_struct(&ping,&ping_info,&end_info);
 #if defined(PNG_SETJMP_NOT_THREAD_SAFE)
@@ -3277,8 +3278,8 @@
 
     if (logging != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  Reading JNG chunk type %c%c%c%c, length: %lu",
-        type[0],type[1],type[2],type[3],(unsigned long) length);
+        "  Reading JNG chunk type %c%c%c%c, length: %.20g",
+        type[0],type[1],type[2],type[3],(double) length);
 
     if (length > PNG_UINT_31_MAX || count == 0)
       ThrowReaderException(CorruptImageError,"CorruptImage");
@@ -4087,8 +4088,8 @@
 
         if (logging != MagickFalse)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-           "  Reading MNG chunk type %c%c%c%c, length: %lu",
-           type[0],type[1],type[2],type[3],(unsigned long) length);
+           "  Reading MNG chunk type %c%c%c%c, length: %.20g",
+           type[0],type[1],type[2],type[3],(double) length);
 
         if (length > PNG_UINT_31_MAX)
           status=MagickFalse;
@@ -4147,9 +4148,9 @@
             if (logging != MagickFalse)
               {
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "  MNG width: %lu",(unsigned long) mng_info->mng_width);
+                  "  MNG width: %.20g",(double) mng_info->mng_width);
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "  MNG height: %lu",(unsigned long) mng_info->mng_height);
+                  "  MNG height: %.20g",(double) mng_info->mng_height);
               }
             p+=8;
             mng_info->ticks_per_second=(size_t) mng_get_long(p);
@@ -4189,8 +4190,8 @@
             if ((mng_info->mng_width > 65535L) ||
                 (mng_info->mng_height > 65535L))
               ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit");
-            (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu+0+0",
-              (unsigned long) mng_info->mng_width,(unsigned long)
+            (void) FormatMagickString(page_geometry,MaxTextExtent,
+              "%.20gx%.20g+0+0",(double) mng_info->mng_width,(double)
               mng_info->mng_height);
             mng_info->frame.left=0;
             mng_info->frame.right=(ssize_t) mng_info->mng_width;
@@ -4225,9 +4226,9 @@
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                   "    repeat=%d",repeat);
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "    final_delay=%ld",(long) final_delay);
+                  "    final_delay=%.20g",(double) final_delay);
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "    image->iterations=%ld",(long) image->iterations);
+                  "    image->iterations=%.20g",(double) image->iterations);
               }
             chunk=(unsigned char *) RelinquishMagickMemory(chunk);
             continue;
@@ -4278,10 +4279,10 @@
                 if (logging != MagickFalse)
                   {
                     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                      "  x_off[%d]: %lu",object_id,(unsigned long)
+                      "  x_off[%d]: %.20g",object_id,(double)
                       mng_info->x_off[object_id]);
                     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                      "  y_off[%d]: %lu",object_id,(unsigned long)
+                      "  y_off[%d]: %.20g",object_id,(double)
                       mng_info->y_off[object_id]);
                   }
               }
@@ -4504,7 +4505,7 @@
                         p+=4;
                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "    Framing_delay=%ld",(long) frame_delay);
+                            "    Framing_delay=%.20g",(double) frame_delay);
                       }
                     if (change_timeout)
                       {
@@ -4519,7 +4520,7 @@
                         p+=4;
                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "    Framing_timeout=%ld",(long) frame_timeout);
+                            "    Framing_timeout=%.20g",(double) frame_timeout);
                       }
                     if (change_clipping)
                       {
@@ -4528,9 +4529,9 @@
                         previous_fb=fb;
                         if (logging != MagickFalse)
                           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "    Frame_clipping: L=%ld R=%ld T=%ld B=%ld",
-                            (long) fb.left,(long) fb.right,(long) fb.top,
-                            (long) fb.bottom);
+                            "    Frame_clipping: L=%.20g R=%.20g T=%.20g B=%.20g",
+                            (double) fb.left,(double) fb.right,(double) fb.top,
+                            (double) fb.bottom);
                         if (change_clipping == 2)
                           default_fb=fb;
                       }
@@ -4548,8 +4549,8 @@
 #if defined(MNG_INSERT_LAYERS)
             if (logging != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "   subframe_width=%lu, subframe_height=%lu",(unsigned long)
-                subframe_width,(unsigned long) subframe_height);
+                "   subframe_width=%.20g, subframe_height=%.20g",(double)
+                subframe_width,(double) subframe_height);
             if (insert_layers && (mng_info->framing_mode == 4) &&
                 (subframe_width) && (subframe_height))
               {
@@ -4588,9 +4589,9 @@
                 (void) SetImageBackgroundColor(image);
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "  Inserted background layer, L=%ld, R=%ld, T=%ld, B=%ld",
-                    (long) mng_info->clip.left,(long) mng_info->clip.right,
-                    (long) mng_info->clip.top,(long) mng_info->clip.bottom);
+                    "  Inserted background layer, L=%.20g, R=%.20g T=%.20g, B=%.20g",
+                    (double) mng_info->clip.left,(double) mng_info->clip.right,
+                    (double) mng_info->clip.top,(double) mng_info->clip.bottom);
               }
 #endif
             chunk=(unsigned char *) RelinquishMagickMemory(chunk);
@@ -4705,8 +4706,8 @@
             loop_iters=mng_get_long(&chunk[1]);
             if (logging != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  LOOP level %ld  has %ld iterations ",(long) loop_level,
-                (long) loop_iters);
+                "  LOOP level %.20g has %.20g iterations ",(double) loop_level,
+                (double) loop_iters);
             if (loop_iters == 0)
               skipping_loop=loop_level;
             else
@@ -4740,8 +4741,8 @@
                     mng_info->loop_iteration[loop_level]++;
                     if (logging != MagickFalse)
                       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                        "  ENDL: LOOP level %ld  has %ld remaining iterations ",
-                        (long) loop_level,(long)
+                        "  ENDL: LOOP level %.20g has %.20g remaining iterations ",
+                        (double) loop_level,(double)
                         mng_info->loop_count[loop_level]);
                     if (mng_info->loop_count[loop_level] != 0)
                       {
@@ -5070,9 +5071,8 @@
                 (void) SetImageBackgroundColor(image);
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "  Inserted transparent background layer, W=%lud, H=%lud",
-                    (unsigned long) mng_info->mng_width,(unsigned long)
-                    mng_info->mng_height);
+                    "  Inserted transparent background layer, W=%.20g, H=%.20g",
+                    (double) mng_info->mng_width,(double) mng_info->mng_height);
               }
           }
         /*
@@ -5118,9 +5118,9 @@
             (void) SetImageBackgroundColor(image);
             if (logging != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  Inserted background layer, L=%ld, R=%ld, T=%ld, B=%ld",
-                (long) mng_info->clip.left,(long) mng_info->clip.right,
-                (long) mng_info->clip.top,(long) mng_info->clip.bottom);
+                "  Inserted background layer, L=%.20g, R=%.20g T=%.20g, B=%.20g",
+                (double) mng_info->clip.left,(double) mng_info->clip.right,
+                (double) mng_info->clip.top,(double) mng_info->clip.bottom);
           }
 #endif /* MNG_INSERT_LAYERS */
         first_mng_object=MagickFalse;
@@ -5354,8 +5354,7 @@
 
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "    Magnify the rows to %lu",(unsigned long)
-                    large_image->rows);
+                    "    Magnify the rows to %.20g",(double) large_image->rows);
                 m=(ssize_t) mng_info->magn_mt;
                 yy=0;
                 length=(size_t) image->columns;
@@ -5487,8 +5486,7 @@
                 /* magnify the columns */
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "    Magnify the columns to %lu",(unsigned long)
-                    image->columns);
+                    "    Magnify the columns to %.20g",(double) image->columns);
 
                 for (y=0; y < (ssize_t) image->rows; y++)
                 {
@@ -5880,8 +5878,8 @@
   image->delay=final_delay;
   if (logging != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  image->delay=%lu, final_delay=%lu",(unsigned long) image->delay,
-        (unsigned long) final_delay);
+        "  image->delay=%.20g, final_delay=%.20g",(double) image->delay,
+        (double) final_delay);
   if (logging != MagickFalse)
     {
       int
@@ -5892,13 +5890,12 @@
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "  Before coalesce:");
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    scene 0 delay=%lu",(unsigned long) image->delay);
+        "    scene 0 delay=%.20g",(double) image->delay);
       while (GetNextImageInList(image) != (Image *) NULL)
       {
         image=GetNextImageInList(image);
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    scene %ld delay=%lu",(long) scene++,(unsigned long)
-          image->delay);
+          "    scene %.20g delay=%.20g",(double) scene++,(double) image->delay);
       }
     }
 
@@ -5959,14 +5956,14 @@
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "  After coalesce:");
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    scene 0 delay=%lu dispose=%ld",(unsigned long) image->delay,
-        (long) image->dispose);
+        "    scene 0 delay=%.20g dispose=%.20g",(double) image->delay,
+        (double) image->dispose);
       while (GetNextImageInList(image) != (Image *) NULL)
       {
         image=GetNextImageInList(image);
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    scene %ld delay=%lu dispose=%ld",(long) scene++,
-          (unsigned long) image->delay,(long) image->dispose);
+          "    scene %.20g delay=%.20g dispose=%.20g",(double) scene++,
+          (double) image->delay,(double) image->dispose);
       }
    }
   image=GetFirstImageInList(image);
@@ -6284,8 +6281,8 @@
 
    if (image_info->verbose)
      {
-     (void) printf("writing raw profile: type=%s, length=%lu\n",
-       (char *) profile_type, length);
+     (void) printf("writing raw profile: type=%s, length=%.20g\n",
+       (char *) profile_type, (double) length);
      }
    text=(png_textp) png_malloc(ping,(png_uint_32) sizeof(png_text));
    description_length=(png_uint_32) strlen((const char *) profile_description);
@@ -6557,15 +6554,15 @@
   if (logging != MagickFalse)
     {
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    width=%lu",(unsigned long) ping_width);
+        "    width=%.20g",(double) ping_width);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    height=%lu",(unsigned long) ping_height);
+        "    height=%.20g",(double) ping_height);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_matte=%lu",(unsigned long) image->matte);
+        "    image_matte=%.20g",(double) image->matte);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_depth=%lu",(unsigned long) image->depth);
+        "    image_depth=%.20g",(double) image->depth);
      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    requested PNG image_depth=%lu",(unsigned long) image->depth);
+        "    requested PNG image_depth=%.20g",(double) image->depth);
     }
   save_image_depth=image_depth;
   ping_bit_depth=(png_byte) save_image_depth;
@@ -6682,7 +6679,7 @@
               (void) SyncImage(image);
               if (logging != MagickFalse)
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "    Colors quantized to %ld",(unsigned long) number_colors);
+                  "    Colors quantized to %.20g",(double) number_colors);
             }
           if (matte)
             png_set_invalid(ping,ping_info,PNG_INFO_tRNS);
@@ -6887,7 +6884,7 @@
            if (logging != MagickFalse)
              {
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "    Number of colors: %lu",(unsigned long) image_colors);
+                "    Number of colors: %.20g",(double) image_colors);
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                 "    Tentative PNG bit depth: %d",ping_bit_depth);
              }
@@ -6903,7 +6900,7 @@
                      {
                        if (logging != MagickFalse)
                          (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                           "    Colors increased to %lu",(unsigned long)
+                           "    Colors increased to %.20g",(double)
                            image_colors);
                      }
                  }
@@ -6914,13 +6911,13 @@
   if (logging != MagickFalse)
     {
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Tentative PNG color type: %d",ping_color_type);
+        "    Tentative PNG color type: %.20g",(double) ping_color_type);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_info->type: %d",image_info->type);
+        "    image_info->type: %.20g",(double) image_info->type);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    image_depth: %lu",(unsigned long) image_depth);
+        "    image_depth: %.20g",(double) image_depth);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    ping_bit_depth: %d",ping_bit_depth);
+        "    ping_bit_depth: %.20g",(double) ping_bit_depth);
     }
 
   if (matte && (mng_info->optimize || mng_info->IsPalette))
@@ -7635,8 +7632,7 @@
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "  Writing PNG image data");
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Allocating %lu bytes of memory for pixels",(unsigned long)
-        rowbytes);
+        "    Allocating %.20g bytes of memory for pixels",(double) rowbytes);
     }
   png_pixels=(unsigned char *) AcquireQuantumMemory(rowbytes,
     sizeof(*png_pixels));
@@ -7872,9 +7868,9 @@
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "  Wrote PNG image data");
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Width: %lu",(unsigned long) ping_width);
+        "    Width: %.20g",(double) ping_width);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Height: %lu",(unsigned long) ping_height);
+        "    Height: %.20g",(double) ping_height);
       if (mng_info->write_png_depth)
         {
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -8384,8 +8380,8 @@
           jng_alpha_sample_depth=8;
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Successfully read jpeg_image into a blob, length=%lu.",
-              (unsigned long) length);
+              "  Successfully read jpeg_image into a blob, length=%.20g.",
+              (double) length);
 
         }
       /* Destroy JPEG image and image_info */
@@ -8609,7 +8605,7 @@
           /* Write IDAT chunk header */
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Write IDAT chunks from blob, length=%lu.",(unsigned long)
+              "  Write IDAT chunks from blob, length=%.20g.",(double)
               length);
 
           /* Copy IDAT chunks */
@@ -8632,8 +8628,8 @@
               {
                 if (logging != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "    Skipping %c%c%c%c chunk, length=%lu.",
-                    *(p),*(p+1),*(p+2),*(p+3),(unsigned long) len);
+                    "    Skipping %c%c%c%c chunk, length=%.20g.",
+                    *(p),*(p+1),*(p+2),*(p+3),(double) len);
               }
             p+=(8+len);
           }
@@ -8643,7 +8639,7 @@
           /* Write JDAA chunk header */
           if (logging != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  Write JDAA chunk, length=%lu.",(unsigned long) length);
+              "  Write JDAA chunk, length=%.20g.",(double) length);
           (void) WriteBlobMSBULong(image,(size_t) length);
           PNGType(chunk,mng_JDAA);
           LogPNGChunk((int) logging,mng_JDAA,length);
@@ -8682,8 +8678,8 @@
 
   if (logging != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  Created jpeg_image, %lu x %lu.",(unsigned long) jpeg_image->columns,
-      (unsigned long) jpeg_image->rows);
+      "  Created jpeg_image, %.20g x %.20g.",(double) jpeg_image->columns,
+      (double) jpeg_image->rows);
 
   if (jng_color_type == 8 || jng_color_type == 12)
     jpeg_image_info->type=GrayscaleType;
@@ -8697,11 +8693,11 @@
   if (logging != MagickFalse)
     {
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  Successfully read jpeg_image into a blob, length=%lu.",
-        (unsigned long) length);
+        "  Successfully read jpeg_image into a blob, length=%.20g.",
+        (double) length);
 
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "  Write JDAT chunk, length=%lu.",(unsigned long) length);
+        "  Write JDAT chunk, length=%.20g.",(double) length);
     }
   /* Write JDAT chunk(s) */
   (void) WriteBlobMSBULong(image,(size_t) length);
@@ -8941,7 +8937,7 @@
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "    Optimize: FALSE");
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "    Image_info depth: %lu",(unsigned long) image_info->depth);
+        "    Image_info depth: %.20g",(double) image_info->depth);
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         "    Type: %d",image_info->type);
 
@@ -8949,9 +8945,9 @@
       for (p=image; p != (Image *) NULL; p=GetNextImageInList(p))
       {
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "    Scene: %lu",(unsigned long) scene++);
+          "    Scene: %.20g",(double) scene++);
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "      Image depth: %lu",(unsigned long) p->depth);
+          "      Image depth: %.20g",(double) p->depth);
         if (p->matte)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "      Matte: True");
@@ -8966,7 +8962,7 @@
             "      Storage class: DirectClass");
         if (p->colors)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-            "      Number of colors: %lu",(unsigned long) p->colors);
+            "      Number of colors: %.20g",(double) p->colors);
         else
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "      Number of colors: unspecified");
@@ -9299,15 +9295,14 @@
          if (logging != MagickFalse)
            {
              (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-               "     TERM delay: %lu",
-               (unsigned long) (mng_info->ticks_per_second*
-                  final_delay/MagickMax(image->ticks_per_second,1)));
+               "     TERM delay: %.20g",(double) (mng_info->ticks_per_second*
+              final_delay/MagickMax(image->ticks_per_second,1)));
              if (image->iterations == 0)
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                 "     TERM iterations: %lu",(unsigned long) PNG_UINT_31_MAX);
+                 "     TERM iterations: %.20g",(double) PNG_UINT_31_MAX);
              else
                (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                 "     Image iterations: %lu",(unsigned long) image->iterations);
+                 "     Image iterations: %.20g",(double) image->iterations);
            }
          (void) WriteBlob(image,14,chunk);
          (void) WriteBlobMSBULong(image,crc32(0,chunk,14));
diff --git a/coders/pnm.c b/coders/pnm.c
index 9313b72..91d67f3 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -1570,8 +1570,8 @@
       {
         if (image->colorspace != RGBColorspace)
           (void) TransformImageColorspace(image,RGBColorspace);
-        (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n",
-          (unsigned long) image->columns,(unsigned long) image->rows);
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n",
+          (double) image->columns,(double) image->rows);
         (void) WriteBlobString(image,buffer);
       }
     else
@@ -1583,8 +1583,8 @@
           PAM header.
         */
         (void) FormatMagickString(buffer,MaxTextExtent,
-          "WIDTH %lu\nHEIGHT %lu\n",(unsigned long) image->columns,
-          (unsigned long) image->rows);
+          "WIDTH %.20g\nHEIGHT %.20g\n",(double) image->columns,(double)
+          image->rows);
         (void) WriteBlobString(image,buffer);
         quantum_type=GetQuantumType(image,&image->exception);
         switch (quantum_type)
@@ -1621,7 +1621,7 @@
         if (image->depth > 16)
           image->depth=16;
         (void) FormatMagickString(buffer,MaxTextExtent,
-          "DEPTH %lu\nMAXVAL %lu\n",(unsigned long) packet_size,(unsigned long)
+          "DEPTH %.20g\nMAXVAL %.20g\n",(double) packet_size,(double)
           GetQuantumRange(image->depth));
         (void) WriteBlobString(image,buffer);
         (void) FormatMagickString(buffer,MaxTextExtent,"TUPLTYPE %s\nENDHDR\n",
@@ -1853,7 +1853,7 @@
         */
         if (image->depth > 8)
           image->depth=16;
-        (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",(unsigned long)
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double)
           GetQuantumRange(image->depth));
         (void) WriteBlobString(image,buffer);
         quantum_info=AcquireQuantumInfo((const ImageInfo *) NULL,image);
@@ -1936,7 +1936,7 @@
         */
         if (image->depth > 8)
           image->depth=16;
-        (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",(unsigned long)
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double)
           GetQuantumRange(image->depth));
         (void) WriteBlobString(image,buffer);
         quantum_info=AcquireQuantumInfo((const ImageInfo *) NULL,image);
diff --git a/coders/ps.c b/coders/ps.c
index cdd0988..86cc859 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -622,8 +622,8 @@
         /*
           Note spot names.
         */
-        (void) FormatMagickString(property,MaxTextExtent,"ps:SpotColor-%lu",
-          spotcolor++);
+        (void) FormatMagickString(property,MaxTextExtent,"ps:SpotColor-%.20g",
+          (double) (spotcolor++));
         for (p=command; *p != '\0'; p++)
           if (isspace((int) (unsigned char) *p) != 0)
             break;
@@ -731,8 +731,8 @@
   page.width=(size_t) floor(page.width*image->x_resolution/delta.x+0.5);
   page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
     0.5);
-  (void) FormatMagickString(options,MaxTextExtent,"-g%lux%lu ",
-    (unsigned long) page.width,(unsigned long) page.height);
+  (void) FormatMagickString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
+    page.width,(double) page.height);
   read_info=CloneImageInfo(image_info);
   *read_info->magick='\0';
   if (read_info->number_scenes != 0)
@@ -740,8 +740,8 @@
       char
         pages[MaxTextExtent];
 
-      (void) FormatMagickString(pages,MaxTextExtent,"-dFirstPage=%lu "
-        "-dLastPage=%lu",(unsigned long) read_info->scene+1,(unsigned long)
+      (void) FormatMagickString(pages,MaxTextExtent,"-dFirstPage=%.20g "
+        "-dLastPage=%.20g",(double) read_info->scene+1,(double)
         (read_info->scene+read_info->number_scenes));
       (void) ConcatenateMagickString(options,pages,MaxTextExtent);
       read_info->number_scenes=0;
@@ -1424,15 +1424,15 @@
         resolution.y=(size_t) (100.0*2.54*resolution.y+0.5)/100.0;
       }
     SetGeometry(image,&geometry);
-    (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
-      (unsigned long) image->columns,(unsigned long) image->rows);
+    (void) FormatMagickString(page_geometry,MaxTextExtent,"%.20gx%.20g",
+      (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MaxTextExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
-        (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
-          (unsigned long) image->page.width,(unsigned long) image->page.height,
-          (long) image->page.x,(long) image->page.y);
+        (void) FormatMagickString(page_geometry,MaxTextExtent,
+          "%.20gx%.20g%+.20gx%+.20g",(double) image->page.width,(double)
+          image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
             (LocaleCompare(image_info->magick,"PS") == 0))
@@ -1490,9 +1490,8 @@
         else
           {
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "%%%%BoundingBox: %ld %ld %ld %ld\n",(long) ceil(bounds.x1-0.5),
-              (long) ceil(bounds.y1-0.5),(long) floor(bounds.x2+0.5),(long)
-              floor(bounds.y2+0.5));
+              "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+              ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
             (void) WriteBlobString(image,buffer);
             (void) FormatMagickString(buffer,MaxTextExtent,
               "%%%%HiResBoundingBox: %g %g %g %g\n",bounds.x1,
@@ -1506,8 +1505,7 @@
               Embed Photoshop profile.
             */
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "%%BeginPhotoshop: %lu",(unsigned long) GetStringInfoLength(
-              profile));
+              "%%BeginPhotoshop: %.20g",(double) GetStringInfoLength(profile));
             (void) WriteBlobString(image,buffer);
             for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
             {
@@ -1527,7 +1525,7 @@
             */
             (void) WriteBlobString(image,"\n%begin_xml_code\n");
             (void) FormatMagickString(buffer,MaxTextExtent,
-               "\n%%begin_xml_packet: %lu\n",(unsigned long)
+               "\n%%begin_xml_packet: %.20g\n",(double)
                GetStringInfoLength(profile));
             (void) WriteBlobString(image,buffer);
             for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
@@ -1549,9 +1547,9 @@
             */
             (void) WriteBlobString(image,"%%Orientation: Portrait\n");
             (void) WriteBlobString(image,"%%PageOrder: Ascend\n");
-            (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Pages: %lu\n",
-              image_info->adjoin != MagickFalse ? (size_t)
-              GetImageListLength(image) : 1UL);
+            (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Pages: %.20g\n",
+              image_info->adjoin != MagickFalse ? (double)
+              GetImageListLength(image) : 1.0);
             (void) WriteBlobString(image,buffer);
           }
         (void) WriteBlobString(image,"%%EndComments\n");
@@ -1583,10 +1581,10 @@
               Dump image as bitmap.
             */
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "%%%%BeginPreview: %lu %lu %lu %lu\n%%  ",(unsigned long)
-              preview_image->columns,(unsigned long) preview_image->rows,1UL,
-              (unsigned long) ((((preview_image->columns+7) >> 3)*
-              preview_image->rows+35)/36));
+              "%%%%BeginPreview: %.20g %.20g %.20g %.20g\n%%  ",(double)
+              preview_image->columns,(double) preview_image->rows,1.0,
+              (double) ((((preview_image->columns+7) >> 3)*preview_image->rows+
+              35)/36));
             (void) WriteBlobString(image,buffer);
             q=pixels;
             for (y=0; y < (ssize_t) image->rows; y++)
@@ -1668,12 +1666,12 @@
         (void) WriteBlobString(image,"} bind def\n");
         (void) WriteBlobString(image,"%%EndProlog\n");
       }
-    (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Page:  1 %lu\n",
-      (unsigned long) page++);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Page:  1 %.20g\n",
+      (double) (page++));
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "%%%%PageBoundingBox: %ld %ld %ld %ld\n",(long) geometry.x,(long)
-      geometry.y,geometry.x+(long) geometry.width,geometry.y+(long)
+      "%%%%PageBoundingBox: %.20g %.20g %.20g %.20g\n",(double) geometry.x,
+      (double) geometry.y,geometry.x+(double) geometry.width,geometry.y+(double)
       (geometry.height+text_size));
     (void) WriteBlobString(image,buffer);
     if ((double) geometry.x < bounds.x1)
@@ -1693,8 +1691,8 @@
     /*
       Output image data.
     */
-    (void) FormatMagickString(buffer,MaxTextExtent,"%ld %ld\n%g %g\n%g\n",
-      (long) geometry.x,(long) geometry.y,scale.x,scale.y,pointsize);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n%g %g\n%g\n",
+      (double) geometry.x,(double) geometry.y,scale.x,scale.y,pointsize);
     (void) WriteBlobString(image,buffer);
     labels=(char **) NULL;
     value=GetImageProperty(image,"label");
@@ -1727,8 +1725,8 @@
               Dump image as grayscale.
             */
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "%lu %lu\n1\n1\n1\n8\n",(unsigned long) image->columns,
-              (unsigned long) image->rows);
+              "%.20g %.20g\n1\n1\n1\n8\n",(double) image->columns,(double)
+              image->rows);
             (void) WriteBlobString(image,buffer);
             q=pixels;
             for (y=0; y < (ssize_t) image->rows; y++)
@@ -1776,8 +1774,8 @@
               Dump image as bitmap.
             */
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "%lu %lu\n1\n1\n1\n1\n",(unsigned long) image->columns,
-              (unsigned long) image->rows);
+              "%.20g %.20g\n1\n1\n1\n1\n",(double) image->columns,(double)
+              image->rows);
             (void) WriteBlobString(image,buffer);
             q=pixels;
             for (y=0; y < (ssize_t) image->rows; y++)
@@ -1843,8 +1841,8 @@
           /*
             Dump DirectClass image.
           */
-          (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n0\n%d\n",
-            (unsigned long) image->columns,(unsigned long) image->rows,
+          (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n0\n%d\n",
+            (double) image->columns,(double) image->rows,
             image_info->compression == RLECompression ? 1 : 0);
           (void) WriteBlobString(image,buffer);
           switch (image_info->compression)
@@ -1968,15 +1966,15 @@
           /*
             Dump PseudoClass image.
           */
-          (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n%d\n%d\n0\n",
-            (unsigned long) image->columns,(unsigned long) image->rows,
-            image->storage_class == PseudoClass ? 1 : 0,
+          (void) FormatMagickString(buffer,MaxTextExtent,
+            "%.20g %.20g\n%d\n%d\n0\n",(double) image->columns,(double)
+            image->rows,image->storage_class == PseudoClass ? 1 : 0,
             image_info->compression == RLECompression ? 1 : 0);
           (void) WriteBlobString(image,buffer);
           /*
             Dump number of colors and colormap.
           */
-          (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",(unsigned long)
+          (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double)
             image->colors);
           (void) WriteBlobString(image,buffer);
           for (i=0; i < (ssize_t) image->colors; i++)
@@ -2106,9 +2104,8 @@
   if (page > 2)
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "%%%%BoundingBox: %ld %ld %ld %ld\n",(long) ceil(bounds.x1-0.5),
-        (long) ceil(bounds.y1-0.5),(long) floor(bounds.x2+0.5),(long)
-        floor(bounds.y2+0.5));
+        "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+        ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
       (void) WriteBlobString(image,buffer);
       (void) FormatMagickString(buffer,MaxTextExtent,
         "%%%%HiResBoundingBox: %g %g %g %g\n",bounds.x1,bounds.y1,
diff --git a/coders/ps2.c b/coders/ps2.c
index e75c548..83351d0 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -515,15 +515,15 @@
         resolution.y=(size_t) (100.0*2.54*resolution.y+0.5)/100.0;
       }
     SetGeometry(image,&geometry);
-    (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
-      (unsigned long) image->columns,(unsigned long) image->rows);
+    (void) FormatMagickString(page_geometry,MaxTextExtent,"%.20gx%.20g",
+      (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MaxTextExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
-        (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
-          (unsigned long) image->page.width,(unsigned long) image->page.height,
-          (long) image->page.x,(long) image->page.y);
+        (void) FormatMagickString(page_geometry,MaxTextExtent,
+          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+          image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
             (LocaleCompare(image_info->magick,"PS") == 0))
@@ -581,9 +581,8 @@
         else
           {
             (void) FormatMagickString(buffer,MaxTextExtent,
-              "%%%%BoundingBox: %ld %ld %ld %ld\n",(long) ceil(bounds.x1-0.5),
-              (long) ceil(bounds.y1-0.5),(long) floor(bounds.x2+0.5),(long)
-              floor(bounds.y2+0.5));
+              "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+              ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
             (void) WriteBlobString(image,buffer);
             (void) FormatMagickString(buffer,MaxTextExtent,
               "%%%%HiResBoundingBox: %g %g %g %g\n",bounds.x1,
@@ -604,8 +603,8 @@
             if (image_info->adjoin == MagickFalse)
               (void) CopyMagickString(buffer,"%%Pages: 1\n",MaxTextExtent);
             else
-              (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Pages: %lu\n",
-                (unsigned long) GetImageListLength(image));
+              (void) FormatMagickString(buffer,MaxTextExtent,
+                "%%%%Pages: %.20g\n",(double) GetImageListLength(image));
             (void) WriteBlobString(image,buffer);
           }
         (void) WriteBlobString(image,"%%EndComments\n");
@@ -672,12 +671,12 @@
         (void) WriteBlobString(image,"} bind def\n");
         (void) WriteBlobString(image,"%%EndProlog\n");
       }
-    (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Page:  1 %lu\n",
-      (unsigned long) page++);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Page:  1 %.20g\n",
+      (double) page++);
     (void) WriteBlobString(image,buffer);
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "%%%%PageBoundingBox: %ld %ld %ld %ld\n",(long) geometry.x,(long)
-      geometry.y, geometry.x+(long) geometry.width,geometry.y+(long)
+      "%%%%PageBoundingBox: %.20g %.20g %.20g %.20g\n",(double) geometry.x,
+      (double) geometry.y,geometry.x+(double) geometry.width,geometry.y+(double)
       (geometry.height+text_size));
     (void) WriteBlobString(image,buffer);
     if ((double) geometry.x < bounds.x1)
@@ -703,8 +702,8 @@
     /*
       Output image data.
     */
-    (void) FormatMagickString(buffer,MaxTextExtent,"%ld %ld\n%g %g\n%g\n",
-      (long) geometry.x,(long) geometry.y,scale.x,scale.y,pointsize);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n%g %g\n%g\n",
+      (double) geometry.x,(double) geometry.y,scale.x,scale.y,pointsize);
     (void) WriteBlobString(image,buffer);
     labels=(char **) NULL;
     value=GetImageProperty(image,"label");
@@ -728,8 +727,8 @@
         ((image_info->type != TrueColorType) &&
          (IsGrayImage(image,&image->exception) != MagickFalse)))
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n1\n%d\n",
-          (unsigned long) image->columns,(unsigned long) image->rows,(int)
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n1\n%d\n",
+          (double) image->columns,(double) image->rows,(int)
           (image->colorspace == CMYKColorspace));
         (void) WriteBlobString(image,buffer);
         (void) FormatMagickString(buffer,MaxTextExtent,"%d\n",
@@ -826,7 +825,8 @@
                   ScaleQuantumToChar(PixelIntensityToQuantum(p)));
                 p++;
               }
-              progress=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,image->rows);
+              progress=SetImageProgress(image,SaveImageTag,(MagickOffsetType)
+                y,image->rows);
               if (progress == MagickFalse)
                 break;
             }
@@ -839,8 +839,8 @@
       if ((image->storage_class == DirectClass) || (image->colors > 256) ||
           (compression == JPEGCompression) || (image->matte != MagickFalse))
         {
-          (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n0\n%d\n",
-            (unsigned long) image->columns,(unsigned long) image->rows,(int)
+          (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n0\n%d\n",
+            (double) image->columns,(double) image->rows,(int)
             (image->colorspace == CMYKColorspace));
           (void) WriteBlobString(image,buffer);
           (void) FormatMagickString(buffer,MaxTextExtent,"%d\n",
@@ -979,14 +979,14 @@
           /*
             Dump number of colors and colormap.
           */
-          (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n1\n%d\n",
-            (unsigned long) image->columns,(unsigned long) image->rows,(int)
+          (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n1\n%d\n",
+            (double) image->columns,(double) image->rows,(int)
             (image->colorspace == CMYKColorspace));
           (void) WriteBlobString(image,buffer);
           (void) FormatMagickString(buffer,MaxTextExtent,"%d\n",
             (int) (compression == NoCompression));
           (void) WriteBlobString(image,buffer);
-          (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",(unsigned long)
+          (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",(double)
             image->colors);
           (void) WriteBlobString(image,buffer);
           for (i=0; i < (ssize_t) image->colors; i++)
@@ -1095,9 +1095,8 @@
   if (page > 1)
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "%%%%BoundingBox: %ld %ld %ld %ld\n",(long) ceil(bounds.x1-0.5),
-        (long) ceil(bounds.y1-0.5),(long) floor(bounds.x2+0.5),(long)
-        floor(bounds.y2+0.5));
+        "%%%%BoundingBox: %.20g %.20g %.20g %.20g\n",ceil(bounds.x1-0.5),
+        ceil(bounds.y1-0.5),floor(bounds.x2+0.5),floor(bounds.y2+0.5));
       (void) WriteBlobString(image,buffer);
       (void) FormatMagickString(buffer,MaxTextExtent,
         "%%%%HiResBoundingBox: %g %g %g %g\n",bounds.x1,bounds.y1,
diff --git a/coders/ps3.c b/coders/ps3.c
index bd720f8..f1508bf 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -478,37 +478,37 @@
     default:
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "currentfile %lu %lu "PS3_NoCompression" ByteStreamDecodeFilter\n",
-        (unsigned long) image->columns,(unsigned long) image->rows);
+        "currentfile %.20g %.20g "PS3_NoCompression" ByteStreamDecodeFilter\n",
+        (double) image->columns,(double) image->rows);
       break;
     }
     case FaxCompression:
     case Group4Compression:
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "currentfile %lu %lu "PS3_FaxCompression" ByteStreamDecodeFilter\n",
-        (unsigned long) image->columns,(unsigned long) image->rows);
+        "currentfile %.20g %.20g "PS3_FaxCompression" ByteStreamDecodeFilter\n",
+        (double) image->columns,(double) image->rows);
       break;
     }
     case LZWCompression:
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "currentfile %lu %lu "PS3_LZWCompression" ByteStreamDecodeFilter\n",
-        (unsigned long) image->columns,(unsigned long) image->rows);
+        "currentfile %.20g %.20g "PS3_LZWCompression" ByteStreamDecodeFilter\n",
+        (double) image->columns,(double) image->rows);
       break;
     }
     case RLECompression:
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "currentfile %lu %lu "PS3_RLECompression" ByteStreamDecodeFilter\n",
-        (unsigned long) image->columns,(unsigned long) image->rows);
+        "currentfile %.20g %.20g "PS3_RLECompression" ByteStreamDecodeFilter\n",
+        (double) image->columns,(double) image->rows);
       break;
     }
     case ZipCompression:
     {
       (void) FormatMagickString(buffer,MaxTextExtent,
-        "currentfile %lu %lu "PS3_ZipCompression" ByteStreamDecodeFilter\n",
-        (unsigned long) image->columns,(unsigned long) image->rows);
+        "currentfile %.20g %.20g "PS3_ZipCompression" ByteStreamDecodeFilter\n",
+        (double) image->columns,(double) image->rows);
       break;
     }
   }
@@ -939,15 +939,15 @@
         resolution.y=(size_t) (100.0*2.54*resolution.y+0.5)/100.0;
       }
     SetGeometry(image,&geometry);
-    (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu",
-      (unsigned long) image->columns,(unsigned long) image->rows);
+    (void) FormatMagickString(page_geometry,MaxTextExtent,"%.20gx%.20g",
+      (double) image->columns,(double) image->rows);
     if (image_info->page != (char *) NULL)
       (void) CopyMagickString(page_geometry,image_info->page,MaxTextExtent);
     else
       if ((image->page.width != 0) && (image->page.height != 0))
-        (void) FormatMagickString(page_geometry,MaxTextExtent,"%lux%lu%+ld%+ld",
-          (unsigned long) image->page.width,(unsigned long) image->page.height,
-          (long) image->page.x,(long) image->page.y);
+        (void) FormatMagickString(page_geometry,MaxTextExtent,
+          "%.20gx%.20g%+.20g%+.20g",(double) image->page.width,(double)
+          image->page.height,(double) image->page.x,(double) image->page.y);
       else
         if ((image->gravity != UndefinedGravity) &&
             (LocaleCompare(image_info->magick,"PS") == 0))
@@ -1045,8 +1045,8 @@
             if (image_info->adjoin == MagickFalse)
               (void) CopyMagickString(buffer,"%%Pages: 1\n",MaxTextExtent);
             else
-              (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Pages: %lu\n",
-                (unsigned long) GetImageListLength(image));
+              (void) FormatMagickString(buffer,MaxTextExtent,
+                "%%%%Pages: %.20g\n",(double) GetImageListLength(image));
             (void) WriteBlobString(image,buffer);
           }
         (void) WriteBlobString(image,"%%EndComments\n");
@@ -1086,16 +1086,16 @@
         }
         (void)WriteBlobString(image,"%%EndProlog\n");
       }
-    (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Page: 1 %lu\n",
-      (unsigned long) page);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%%%%Page: 1 %.20g\n",
+      (double) page);
     (void) WriteBlobString(image,buffer);
     /*
       Page bounding box.
     */
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "%%%%PageBoundingBox: %ld %ld %ld %ld\n",(long) geometry.x,(long)
-       geometry.y,geometry.x+(long) geometry.width,geometry.y+(long)
-       (geometry.height+text_size));
+      "%%%%PageBoundingBox: %.20g %.20g %.20g %.20g\n",(double) geometry.x,
+       (double) geometry.y,geometry.x+(double) geometry.width,geometry.y+
+       (double) (geometry.height+text_size));
     (void) WriteBlobString(image,buffer);
     /*
       Page process colors if not RGB.
@@ -1167,8 +1167,8 @@
     /*
       Translate, scale, and font point size.
     */
-    (void) FormatMagickString(buffer,MaxTextExtent,"%ld %ld\n%g %g\n%g\n",
-      (long) geometry.x,(long) geometry.y,scale.x,scale.y,pointsize);
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n%g %g\n%g\n",
+      (double) geometry.x,(double) geometry.y,scale.x,scale.y,pointsize);
     (void) WriteBlobString(image,buffer);
     /*
       Output labels.
@@ -1215,8 +1215,8 @@
     /*
       Image columns, rows, and color space.
     */
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n%s\n",
-      (unsigned long) image->columns,(unsigned long) image->rows,
+    (void) FormatMagickString(buffer,MaxTextExtent,"%.20g %.20g\n%s\n",
+      (double) image->columns,(double) image->rows,
       image->colorspace == CMYKColorspace ? PS3_CMYKColorspace :
       PS3_RGBColorspace);
     (void) WriteBlobString(image,buffer);
@@ -1471,8 +1471,8 @@
             /*
               Number of colors in color map.
             */
-            (void) FormatMagickString(buffer,MaxTextExtent,"%lu\n",
-              (unsigned long) image->colors);
+            (void) FormatMagickString(buffer,MaxTextExtent,"%.20g\n",
+              (double) image->colors);
             (void) WriteBlobString(image,buffer);
             /*
               Color map - uncompressed.
diff --git a/coders/psd.c b/coders/psd.c
index 8167802..7227238 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -774,10 +774,10 @@
   psd_info.mode=ReadBlobMSBShort(image);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-      "  Image is %lu x %lu with channels=%lu, depth=%lu, mode=%s",
-      (unsigned long) psd_info.columns,(unsigned long) psd_info.rows,
-      (unsigned long) psd_info.channels,(unsigned long) psd_info.depth,
-      ModeToString((PSDImageType) psd_info.mode));
+      "  Image is %.20g x %.20g with channels=%.20g, depth=%.20g, mode=%s",
+      (double) psd_info.columns,(double) psd_info.rows,(double)
+      psd_info.channels,(double) psd_info.depth,ModeToString((PSDImageType)
+      psd_info.mode));
   /*
     Initialize image.
   */
@@ -863,7 +863,7 @@
       */
       if (image->debug != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-          "  reading image resource blocks - %lu bytes",(unsigned long) length);
+          "  reading image resource blocks - %.20g bytes",(double) length);
       blocks=(unsigned char *) AcquireQuantumMemory((size_t) length,
         sizeof(*blocks));
       if (blocks == (unsigned char *) NULL)
@@ -936,7 +936,7 @@
           number_layers=(short) ReadBlobMSBShort(image);
           if (image->debug != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  image contains %ld layers",(long) number_layers);
+              "  image contains %.20g layers",(double) number_layers);
           if (number_layers < 0)
             {
               /*
@@ -963,7 +963,7 @@
           {
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "  reading layer #%ld",(long) i+1);
+                "  reading layer #%.20g",(double) i+1);
             layer_info[i].page.y=(ssize_t) ReadBlobMSBLong(image);
             layer_info[i].page.x=(ssize_t) ReadBlobMSBLong(image);
             layer_info[i].page.height=(size_t)
@@ -979,10 +979,10 @@
               ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "    offset(%ld,%ld), size(%ld,%ld), channels=%ld",
-                (long) layer_info[i].page.x,(long) layer_info[i].page.y,
-                (long) layer_info[i].page.height,(long)
-                layer_info[i].page.width,(long) layer_info[i].channels);
+                "    offset(%.20g,%.20g), size(%.20g,%.20g), channels=%.20g",
+                (double) layer_info[i].page.x,(double) layer_info[i].page.y,
+                (double) layer_info[i].page.height,(double)
+                layer_info[i].page.width,(double) layer_info[i].channels);
             for (j=0; j < (ssize_t) layer_info[i].channels; j++)
             {
               layer_info[i].channel_info[j].type=(short)
@@ -991,9 +991,9 @@
                 GetPSDSize(&psd_info,image);
               if (image->debug != MagickFalse)
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "    channel[%ld]: type=%ld, size=%ld",(long) j,
-                  (long) layer_info[i].channel_info[j].type,
-                  (long) layer_info[i].channel_info[j].size);
+                  "    channel[%.20g]: type=%.20g, size=%.20g",(double) j,
+                  (double) layer_info[i].channel_info[j].type,
+                  (double) layer_info[i].channel_info[j].size);
             }
             count=ReadBlob(image,4,(unsigned char *) type);
             if ((count == 0) || (LocaleNCompare(type,"8BIM",4) != 0))
@@ -1011,8 +1011,8 @@
             layer_info[i].visible=!(layer_info[i].flags & 0x02);
             if (image->debug != MagickFalse)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                "   blend=%.4s, opacity=%lu, clipping=%s, flags=%d, visible=%s",
-                layer_info[i].blendkey,(long) layer_info[i].opacity,
+                "   blend=%.4s, opacity=%.20g, clipping=%s, flags=%d, visible=%s",
+                layer_info[i].blendkey,(double) layer_info[i].opacity,
                 layer_info[i].clipping ? "true" : "false",layer_info[i].flags,
                 layer_info[i].visible ? "true" : "false");
             (void) ReadBlobByte(image);  /* filler */
@@ -1041,10 +1041,10 @@
                       layer_info[i].mask.width+=4294967295UL;
                     if (image->debug != MagickFalse)
                       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                        "      layer mask: offset(%ld,%ld), size(%ld,%ld), length=%ld",
-                        (long) layer_info[i].mask.x,(long) layer_info[i].mask.y,
-                        (long) layer_info[i].mask.width,(long)
-                        layer_info[i].mask.height,(long) length-16);
+                        "      layer mask: offset(%.20g,%.20g), size(%.20g,%.20g), length=%.20g",
+                        (double) layer_info[i].mask.x,(double) layer_info[i].mask.y,
+                        (double) layer_info[i].mask.width,(double)
+                        layer_info[i].mask.height,(double) length-16);
                     /*
                       Skip over the rest of the layer mask information.
                     */
@@ -1060,7 +1060,7 @@
                     */
                     if (image->debug != MagickFalse)
                       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                        "      layer blending ranges: length=%ld",(long)
+                        "      layer blending ranges: length=%.20g",(double)
                         length);
                     /*
                       We read it, but don't use it...
@@ -1111,8 +1111,8 @@
               {
       if (image->debug != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                            "      adjustment layer key: %.4s, data length=%ld",
-                            alkey, length);
+                            "      adjustment layer key: %.4s, data length=%.20g",
+                            alkey, (double) length);
               }
 
               if ( length ) {
@@ -1129,7 +1129,7 @@
                 */
                 if (image->debug != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "      unsupported data: length=%ld",(long)
+                    "      unsupported data: length=%.20g",(double)
                     (size-combinedlength));
                 for (j=0; j < (ssize_t) (size-combinedlength); j++)
                   (void) ReadBlobByte(image);
@@ -1145,7 +1145,7 @@
                   layer_info[j].image=DestroyImage(layer_info[j].image);
                 if (image->debug != MagickFalse)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                    "  allocation of image for layer %ld failed",(long) i);
+                    "  allocation of image for layer %.20g failed",(double) i);
                 ThrowReaderException(ResourceLimitError,
                   "MemoryAllocationFailed");
               }
@@ -1169,14 +1169,14 @@
             /*
               Set up some hidden attributes for folks that need them.
             */
-            (void) FormatMagickString(message,MaxTextExtent,"%ld",
-              (long) layer_info[i].page.x);
+            (void) FormatMagickString(message,MaxTextExtent,"%.20gld",
+              (double) layer_info[i].page.x);
             (void) SetImageArtifact(layer_info[i].image,"psd:layer.x",message);
-            (void) FormatMagickString(message,MaxTextExtent,"%ld",
-              (long) layer_info[i].page.y);
+            (void) FormatMagickString(message,MaxTextExtent,"%.20g",
+              (double) layer_info[i].page.y);
             (void) SetImageArtifact(layer_info[i].image,"psd:layer.y",message);
-            (void) FormatMagickString(message,MaxTextExtent,"%lu",
-              (unsigned long) layer_info[i].opacity);
+            (void) FormatMagickString(message,MaxTextExtent,"%.20g",
+              (double) layer_info[i].opacity);
             (void) SetImageArtifact(layer_info[i].image,"psd:layer.opacity",
               message);
             (void) SetImageProperty(layer_info[i].image,"label",(char *)
@@ -1192,12 +1192,12 @@
         {
           if (image->debug != MagickFalse)
             (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-              "  reading data for layer %ld",(long) i);
+              "  reading data for layer %.20g",(double) i);
             for (j=0; j < (ssize_t) layer_info[i].channels; j++)
             {
               if (image->debug != MagickFalse)
                 (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-                  "    reading data for channel %ld",(long) j);
+                  "    reading data for channel %.20g",(double) j);
 #if     1
               if (layer_info[i].channel_info[j].size <= (2*layer_info[i].image->rows))
                 {
diff --git a/coders/svg.c b/coders/svg.c
index 7e533ae..784d97c 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -2116,8 +2116,8 @@
             svg_info->view_box=svg_info->bounds;
           svg_info->width=(size_t) floor(svg_info->bounds.width+0.5);
           svg_info->height=(size_t) floor(svg_info->bounds.height+0.5);
-          MVGPrintf(svg_info->file,"viewbox 0 0 %lu %lu\n",(unsigned long)
-            svg_info->width,(unsigned long) svg_info->height);
+          MVGPrintf(svg_info->file,"viewbox 0 0 %.20g %.20g\n",(double)
+            svg_info->width,(double) svg_info->height);
           sx=(double) svg_info->width/svg_info->view_box.width;
           sy=(double) svg_info->height/svg_info->view_box.height;
           MVGPrintf(svg_info->file,"affine %g 0 0 %g 0.0 0.0\n",sx,sy);
@@ -2411,7 +2411,7 @@
     Receiving some characters from the parser.
   */
   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-    "  SAX.characters(%s,%lu)",c,(unsigned long) length);
+    "  SAX.characters(%s,%.20g)",c,(double) length);
   svg_info=(SVGInfo *) context;
   if (svg_info->text != (char *) NULL)
     svg_info->text=(char *) ResizeQuantumMemory(svg_info->text,
@@ -3320,8 +3320,8 @@
     (void) WriteBlobString(image,
       "  \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n");
     (void) FormatMagickString(message,MaxTextExtent,
-      "<svg width=\"%lu\" height=\"%lu\">\n",(unsigned long) image->columns,
-      (unsigned long) image->rows);
+      "<svg width=\"%.20g\" height=\"%.20g\">\n",(double) image->columns,
+      (double) image->rows);
     (void) WriteBlobString(image,message);
     GetMagickPixelPacket(image,&pixel);
     for (y=0; y < (ssize_t) image->rows; y++)
@@ -3336,8 +3336,8 @@
         (void) QueryMagickColorname(image,&pixel,SVGCompliance,tuple,
           &image->exception);
         (void) FormatMagickString(message,MaxTextExtent,
-          "  <circle cx=\"%ld\" cy=\"%ld\" r=\"1\" fill=\"%s\"/>\n",(long) x,
-          (long) y,tuple);
+          "  <circle cx=\"%.20g\" cy=\"%.20g\" r=\"1\" fill=\"%s\"/>\n",
+          (double) x,(double) y,tuple);
         (void) WriteBlobString(image,message);
         p++;
       }
@@ -3432,8 +3432,8 @@
   (void) WriteBlobString(image,
     "  \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n");
   (void) FormatMagickString(message,MaxTextExtent,
-    "<svg width=\"%lu\" height=\"%lu\">\n",(unsigned long) image->columns,
-    (unsigned long) image->rows);
+    "<svg width=\"%.20g\" height=\"%.20g\">\n",(double) image->columns,(double)
+    image->rows);
   (void) WriteBlobString(image,message);
   /*
     Allocate primitive info memory.
diff --git a/coders/tiff.c b/coders/tiff.c
index d029806..48f8b8a 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -927,8 +927,8 @@
     image->rows=(size_t) height;
     image->depth=(size_t) bits_per_sample;
     if (image->debug != MagickFalse)
-      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Image depth: %lu",
-        (unsigned long) image->depth);
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"Image depth: %.20g",
+        (double) image->depth);
     lsb_first=1;
     image->endian=MSBEndian;
     if ((int) (*(char *) &lsb_first) != 0)
diff --git a/coders/ttf.c b/coders/ttf.c
index e3e489b..549795e 100644
--- a/coders/ttf.c
+++ b/coders/ttf.c
@@ -249,11 +249,11 @@
   draw_info=CloneDrawInfo(image_info,(DrawInfo *) NULL);
   draw_info->font=AcquireString(image->filename);
   ConcatenateString(&draw_info->primitive,"push graphic-context\n");
-  (void) FormatMagickString(buffer,MaxTextExtent," viewbox 0 0 %lu %lu\n",
-    (unsigned long) image->columns,(unsigned long) image->rows);
+  (void) FormatMagickString(buffer,MaxTextExtent," viewbox 0 0 %.20g %.20g\n",
+    (double) image->columns,(double) image->rows);
   ConcatenateString(&draw_info->primitive,buffer);
   ConcatenateString(&draw_info->primitive," font-size 18\n");
-  (void) FormatMagickString(buffer,MaxTextExtent," text 10,%ld '",(long) y);
+  (void) FormatMagickString(buffer,MaxTextExtent," text 10,%.20g '",(double) y);
   ConcatenateString(&draw_info->primitive,buffer);
   text=EscapeString(Text,'"');
   ConcatenateString(&draw_info->primitive,text);
@@ -265,13 +265,14 @@
   {
     y+=i+12;
     ConcatenateString(&draw_info->primitive," font-size 18\n");
-    (void) FormatMagickString(buffer,MaxTextExtent," text 10,%ld '%ld'\n",
-      (long) y,(long) i);
+    (void) FormatMagickString(buffer,MaxTextExtent," text 10,%.20g '%.20g'\n",
+      (double) y,(double) i);
     ConcatenateString(&draw_info->primitive,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent," font-size %ld\n",(long) i);
+    (void) FormatMagickString(buffer,MaxTextExtent," font-size %.20g\n",
+      (double) i);
     ConcatenateString(&draw_info->primitive,buffer);
-    (void) FormatMagickString(buffer,MaxTextExtent," text 50,%ld "
-      "'That which does not destroy me, only makes me stronger.'\n",(long) y);
+    (void) FormatMagickString(buffer,MaxTextExtent," text 50,%.20g "
+      "'That which does not destroy me, only makes me stronger.'\n",(double) y);
     ConcatenateString(&draw_info->primitive,buffer);
     if (i >= 24)
       i+=6;
diff --git a/coders/txt.c b/coders/txt.c
index 6ec1a6e..6448dbc 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -659,8 +659,8 @@
     if (image->matte != MagickFalse)
       (void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
     (void) FormatMagickString(buffer,MaxTextExtent,
-      "# ImageMagick pixel enumeration: %lu,%lu,%lu,%s\n",(unsigned long)
-      image->columns,(unsigned long) image->rows,(unsigned long)
+      "# ImageMagick pixel enumeration: %.20g,%.20g,%.20g,%s\n",(double)
+      image->columns,(double) image->rows,(double)
       GetQuantumRange(image->depth),colorspace);
     (void) WriteBlobString(image,buffer);
     GetMagickPixelPacket(image,&pixel);
@@ -672,8 +672,8 @@
       indexes=GetVirtualIndexQueue(image);
       for (x=0; x < (ssize_t) image->columns; x++)
       {
-        (void) FormatMagickString(buffer,MaxTextExtent,"%ld,%ld: ",(long) x,
-          (long) y);
+        (void) FormatMagickString(buffer,MaxTextExtent,"%.20g,%.20g: ",(double)
+          x,(double) y);
         (void) WriteBlobString(image,buffer);
         SetMagickPixelPacket(image,p,indexes+x,&pixel);
         (void) CopyMagickString(tuple,"(",MaxTextExtent);
diff --git a/coders/vicar.c b/coders/vicar.c
index ff99165..54f1dcd 100644
--- a/coders/vicar.c
+++ b/coders/vicar.c
@@ -462,10 +462,10 @@
   */
   (void) ResetMagickMemory(header,' ',MaxTextExtent);
   (void) FormatMagickString(header,MaxTextExtent,
-    "LBLSIZE=%lu FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
-    "RECSIZE=%lu ORG='BSQ' NL=%lu NS=%lu NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
-    "NLB=0 TASK='ImageMagick'",(unsigned long) MaxTextExtent,(unsigned long)
-    image->columns,(unsigned long) image->rows,(unsigned long) image->columns);
+    "LBLSIZE=%.20g FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
+    "RECSIZE=%.20g ORG='BSQ' NL=%.20g NS=%.20g NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
+    "NLB=0 TASK='ImageMagick'",(double) MaxTextExtent,(double) image->columns,
+    (double) image->rows,(double) image->columns);
   (void) WriteBlob(image,MaxTextExtent,(unsigned char *) header);
   /*
     Write VICAR pixels.
diff --git a/coders/vid.c b/coders/vid.c
index 215f08e..6d59413 100644
--- a/coders/vid.c
+++ b/coders/vid.c
@@ -174,8 +174,9 @@
     (void) SetImageProperty(next_image,"label",label);
     label=DestroyString(label);
     if (image_info->debug != MagickFalse)
-      (void) LogMagickEvent(CoderEvent,GetMagickModule(),"geometry: %lux%lu",
-        (unsigned long) next_image->columns,(unsigned long) next_image->rows);
+      (void) LogMagickEvent(CoderEvent,GetMagickModule(),
+        "geometry: %.20gx%.20g",(double) next_image->columns,(double)
+        next_image->rows);
     SetGeometry(next_image,&geometry);
     (void) ParseMetaGeometry(read_info->size,&geometry.x,&geometry.y,
       &geometry.width,&geometry.height);
@@ -188,8 +189,8 @@
       }
     if (image_info->debug != MagickFalse)
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
-        "thumbnail geometry: %lux%lu",(unsigned long) next_image->columns,
-        (unsigned long) next_image->rows);
+        "thumbnail geometry: %.20gx%.20g",(double) next_image->columns,(double)
+        next_image->rows);
     AppendImageToList(&images,next_image);
     status=SetImageProgress(images,LoadImagesTag,i,number_files);
     if (status == MagickFalse)
diff --git a/coders/wpg.c b/coders/wpg.c
index dd1e517..c9b4a64 100644
--- a/coders/wpg.c
+++ b/coders/wpg.c
@@ -597,8 +597,8 @@
           if(x!=0)
             {
               (void) fprintf(stderr,
-                             "\nUnsupported WPG2 unaligned token RST x=%lu, please report!\n"
-                             ,(unsigned long) x);
+                             "\nUnsupported WPG2 unaligned token RST x=%.20g, please report!\n"
+                             ,(double) x);
               return(-3);
             }
           {
diff --git a/coders/xbm.c b/coders/xbm.c
index 4aef1fc..e94f2d9 100644
--- a/coders/xbm.c
+++ b/coders/xbm.c
@@ -516,11 +516,11 @@
     Write X bitmap header.
   */
   GetPathComponent(image->filename,BasePath,basename);
-  (void) FormatMagickString(buffer,MaxTextExtent,"#define %s_width %lu\n",
-    basename,(unsigned long) image->columns);
+  (void) FormatMagickString(buffer,MaxTextExtent,"#define %s_width %.20g\n",
+    basename,(double) image->columns);
   (void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
-  (void) FormatMagickString(buffer,MaxTextExtent,"#define %s_height %lu\n",
-    basename,(unsigned long) image->rows);
+  (void) FormatMagickString(buffer,MaxTextExtent,"#define %s_height %.20g\n",
+    basename,(double) image->rows);
   (void) WriteBlob(image,strlen(buffer),(unsigned char *) buffer);
   (void) FormatMagickString(buffer,MaxTextExtent,
     "static char %s_bits[] = {\n",basename);
diff --git a/coders/xpm.c b/coders/xpm.c
index a3bc383..94a1607 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -742,9 +742,9 @@
     "static char *%s[] = {\n",basename);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"\"%lu %lu %lu %lu\",\n",
-    (unsigned long) picon->columns,(unsigned long) picon->rows,(unsigned long)
-    colors,(unsigned long) characters_per_pixel);
+  (void) FormatMagickString(buffer,MaxTextExtent,
+    "\"%.20g %.20g %.20g %.20g\",\n",(double) picon->columns,(double)
+    picon->rows,(double) colors,(double) characters_per_pixel);
   (void) WriteBlobString(image,buffer);
   GetMagickPixelPacket(image,&pixel);
   for (i=0; i < (ssize_t) colors; i++)
@@ -975,9 +975,9 @@
     "static char *%s[] = {\n",basename);
   (void) WriteBlobString(image,buffer);
   (void) WriteBlobString(image,"/* columns rows colors chars-per-pixel */\n");
-  (void) FormatMagickString(buffer,MaxTextExtent,"\"%lu %lu %lu %lu\",\n",
-    (unsigned long) image->columns,(unsigned long) image->rows,(unsigned long)
-    image->colors,(unsigned long) characters_per_pixel);
+  (void) FormatMagickString(buffer,MaxTextExtent,
+    "\"%.20g %.20g %.20g %.20g \",\n",(double) image->columns,(double)
+    image->rows,(double) image->colors,(double) characters_per_pixel);
   (void) WriteBlobString(image,buffer);
   GetMagickPixelPacket(image,&pixel);
   for (i=0; i < (ssize_t) image->colors; i++)
diff --git a/coders/xps.c b/coders/xps.c
index 3493b86..eaa6c57 100644
--- a/coders/xps.c
+++ b/coders/xps.c
@@ -263,8 +263,8 @@
     (void) ParseAbsoluteGeometry(PSPageGeometry,&page);
   if (image_info->page != (char *) NULL)
     (void) ParseAbsoluteGeometry(image_info->page,&page);
-  (void) FormatMagickString(geometry,MaxTextExtent,"%lux%lu",
-    (unsigned long) page.width,(unsigned long) page.height);
+  (void) FormatMagickString(geometry,MaxTextExtent,"%.20gx%.20g",(double)
+    page.width,(double) page.height);
   if (image_info->monochrome != MagickFalse)
     delegate_info=GetDelegateInfo("xps:mono",(char *) NULL,exception);
   else
@@ -282,20 +282,20 @@
   page.width=(size_t) floor(page.width*image->y_resolution/delta.x+0.5);
   page.height=(size_t) floor(page.height*image->y_resolution/delta.y+
     0.5);
-  (void) FormatMagickString(options,MaxTextExtent,"-g%lux%lu ",
-    (unsigned long) page.width,(unsigned long) page.height);
+  (void) FormatMagickString(options,MaxTextExtent,"-g%.20gx%.20g ",(double)
+    page.width,(double) page.height);
   image=DestroyImage(image);
   read_info=CloneImageInfo(image_info);
   *read_info->magick='\0';
   if (read_info->number_scenes != 0)
     {
       if (read_info->number_scenes != 1)
-        (void) FormatMagickString(options,MaxTextExtent,"-dLastPage=%lu",
-          (unsigned long) (read_info->scene+read_info->number_scenes));
+        (void) FormatMagickString(options,MaxTextExtent,"-dLastPage=%.20g",
+          (double) (read_info->scene+read_info->number_scenes));
       else
         (void) FormatMagickString(options,MaxTextExtent,
-          "-dFirstPage=%lu -dLastPage=%lu",(unsigned long) read_info->scene+1,
-          (unsigned long) (read_info->scene+read_info->number_scenes));
+          "-dFirstPage=%.20g -dLastPage=%.20g",(double) read_info->scene+1,
+          (double) (read_info->scene+read_info->number_scenes));
       read_info->number_scenes=0;
       if (read_info->scenes != (char *) NULL)
         *read_info->scenes='\0';