about summary refs log tree commit diff
path: root/converter/other
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-12-25 20:40:38 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-12-25 20:40:38 +0000
commitca4e5d91a96387bc270692f520b5a30c09856c16 (patch)
tree3b90d98f59c6d2e48c68aa07c4768d5a3642b0b1 /converter/other
parente8724e9798d00fac3326f03ff9fdd616bdc8fce6 (diff)
downloadnetpbm-mirror-ca4e5d91a96387bc270692f520b5a30c09856c16.tar.gz
netpbm-mirror-ca4e5d91a96387bc270692f520b5a30c09856c16.tar.xz
netpbm-mirror-ca4e5d91a96387bc270692f520b5a30c09856c16.zip
Update Advanced series to 10.69
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2351 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rwxr-xr-xconverter/other/anytopnm2
-rw-r--r--converter/other/giftopnm.c35
-rw-r--r--converter/other/pngtopam.c14
-rw-r--r--converter/other/pnmtopalm/pnmtopalm.c6
-rw-r--r--converter/other/pnmtops.c16
5 files changed, 52 insertions, 21 deletions
diff --git a/converter/other/anytopnm b/converter/other/anytopnm
index acf88136..f3a00793 100755
--- a/converter/other/anytopnm
+++ b/converter/other/anytopnm
@@ -379,7 +379,7 @@ case "$2" in
         ;;
 
     gif )
-        giftopnm "$file"
+        giftopnm -image=all "$file"
         ;;
 
     tiff )
diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c
index 9a543532..9f4bc8a1 100644
--- a/converter/other/giftopnm.c
+++ b/converter/other/giftopnm.c
@@ -1674,6 +1674,28 @@ readImageData(FILE *       const ifP,
 
 
 static void
+warnUserNotSquare(unsigned int const aspectRatio) {
+
+    const char * baseMsg =
+        "warning - input pixels are not square, "
+        "but we are rendering them as square pixels "
+        "in the output";
+
+    if (pm_have_float_format()) {
+        float const r = ((float)aspectRatio + 15.0 ) / 64.0;
+
+        pm_message("%s.  To fix the output, run it through "
+                   "'pamscale -%cscale %g'",
+                   baseMsg,
+                   r < 1.0 ? 'x' : 'y',
+                   r < 1.0 ? 1.0 / r : r );
+    } else
+        pm_message("%s", baseMsg);
+}
+
+
+
+static void
 readGifHeader(FILE *             const gifFileP,
               struct gifScreen * const gifScreenP) {
 /*----------------------------------------------------------------------------
@@ -1734,17 +1756,8 @@ readGifHeader(FILE *             const gifFileP,
         }
     }
     
-    if (gifScreenP->AspectRatio != 0 && gifScreenP->AspectRatio != 49) {
-        float   r;
-        r = ( (float) gifScreenP->AspectRatio + 15.0 ) / 64.0;
-        pm_message("warning - input pixels are not square, "
-                   "but we are rendering them as square pixels "
-                   "in the output.  "
-                   "To fix the output, run it through "
-                   "'pnmscale -%cscale %g'",
-                   r < 1.0 ? 'x' : 'y',
-                   r < 1.0 ? 1.0 / r : r );
-    }
+    if (gifScreenP->AspectRatio != 0 && gifScreenP->AspectRatio != 49)
+        warnUserNotSquare(gifScreenP->AspectRatio);
 }
 
 
diff --git a/converter/other/pngtopam.c b/converter/other/pngtopam.c
index e6e68587..59b29f5f 100644
--- a/converter/other/pngtopam.c
+++ b/converter/other/pngtopam.c
@@ -1243,10 +1243,16 @@ warnNonsquarePixels(struct pngx * const pngxP,
             (float)pngx_xPixelsPerMeter(pngxP) / pngx_yPixelsPerMeter(pngxP);
 
         if (r != 1.0) {
-            pm_message ("warning - non-square pixels; "
-                        "to fix do a 'pamscale -%cscale %g'",
-                        r < 1.0 ? 'x' : 'y',
-                        r < 1.0 ? 1.0 / r : r );
+            const char * const baseMsg = "warning - non-square pixels";
+
+            if (pm_have_float_format())
+                pm_message("%s; to fix do a 'pamscale -%cscale %g'",
+                           baseMsg,
+                           r < 1.0 ? 'x' : 'y',
+                           r < 1.0 ? 1.0 / r : r);
+            else
+                pm_message("%s", baseMsg);
+
             *errorLevelP = PNMTOPNG_WARNING_LEVEL;
         }
     }
diff --git a/converter/other/pnmtopalm/pnmtopalm.c b/converter/other/pnmtopalm/pnmtopalm.c
index 67a17e54..7740a3ac 100644
--- a/converter/other/pnmtopalm/pnmtopalm.c
+++ b/converter/other/pnmtopalm/pnmtopalm.c
@@ -33,8 +33,8 @@ struct cmdline_info {
     /* All the information the user supplied in the command line,
        in a form easy for the program to use.
     */
-    const char *inputFilespec;  /* Filespecs of input files */
-    char *transparent;          /* -transparent value.  Null if unspec */
+    const char * inputFilespec;  /* Filespecs of input files */
+    const char * transparent;    /* -transparent value.  Null if unspec */
     unsigned int depth;         /* -depth value.  0 if unspec */
     unsigned int maxdepth;      /* -maxdepth value.  0 if unspec */
     enum compressionType compression;
@@ -289,7 +289,7 @@ formatName(int const format) {
         
 
 static void
-findTransparentColor(char *         const colorSpec, 
+findTransparentColor(const char *   const colorSpec, 
                      pixval         const newMaxval,
                      bool           const directColor, 
                      pixval         const maxval, 
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