about summary refs log tree commit diff
path: root/converter/other/pnmtops.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-11-22 18:41:45 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-11-22 18:41:45 +0000
commitf3316d36985ad16f1d82aea44eddc311cb739d6d (patch)
tree82f3a6c450ec8394baa9b588962d4497e7a704a4 /converter/other/pnmtops.c
parent09bcfca6b8a98a40a1895ae8a66dd3fc1344a966 (diff)
downloadnetpbm-mirror-f3316d36985ad16f1d82aea44eddc311cb739d6d.tar.gz
netpbm-mirror-f3316d36985ad16f1d82aea44eddc311cb739d6d.tar.xz
netpbm-mirror-f3316d36985ad16f1d82aea44eddc311cb739d6d.zip
Fix %g for platform without vasprintf (but scores of %f still exist)
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2320 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/pnmtops.c')
-rw-r--r--converter/other/pnmtops.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 316b7626..cf6b2873 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -1125,6 +1125,19 @@ validateComputableBoundingBox(float const scols,
 
 
 static void
+warnUserRescaling(float const scale) {
+
+    const char * const baseMsg = "warning, image too large for page";
+
+    if (pm_have_float_format())
+        pm_message("%s; rescaling to %g", baseMsg, scale);
+    else
+        pm_message("%s; rescaling", baseMsg);
+}
+
+
+
+static void
 computeImagePosition(int     const dpiX, 
                      int     const dpiY, 
                      int     const icols, 
@@ -1231,8 +1244,7 @@ computeImagePosition(int     const dpiX,
         *srowsP = scale * rows * pixfacY;
     
         if (scale != requestedScale)
-            pm_message("warning, image too large for page, rescaling to %g", 
-                       scale );
+            warnUserRescaling(scale);
 
         /* Before May 2001, Pnmtops enforced a 5% margin around the page.
            If the image would be too big to leave a 5% margin, Pnmtops would