about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-07-30 16:19:22 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-07-30 16:19:22 +0000
commit8d52ce5e21903e601e6bda24ad715b4a77259009 (patch)
tree987580d5e6116e82189138c11f7c8d66c1c22211
parent5847a7a3b80d5a6922dbf13ac8dc7d5eef6d270e (diff)
downloadnetpbm-mirror-8d52ce5e21903e601e6bda24ad715b4a77259009.tar.gz
netpbm-mirror-8d52ce5e21903e601e6bda24ad715b4a77259009.tar.xz
netpbm-mirror-8d52ce5e21903e601e6bda24ad715b4a77259009.zip
Release 10.35.30
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@368 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--Makefile.version2
-rw-r--r--converter/other/pnmtops.c29
-rw-r--r--doc/HISTORY6
3 files changed, 28 insertions, 9 deletions
diff --git a/Makefile.version b/Makefile.version
index c40157a0..896e81ee 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 35
-NETPBM_POINT_RELEASE = 29
+NETPBM_POINT_RELEASE = 30
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index 9f6de526..eb9cbf6f 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -971,16 +971,29 @@ computeDepth(xelval         const inputMaxval,
         *bitspersampleP = 2;
     else if (bitsRequiredByMaxval <= 4)
         *bitspersampleP = 4;
-    else if (bitsRequiredByMaxval <= 8 || postscriptLevel < 2)
+    else        
         *bitspersampleP = 8;
-    else
-        *bitspersampleP = 12;
 
-    if (*bitspersampleP < bitsRequiredByMaxval)
-        pm_message("Maxval of input requires %u bit samples for full "
-                   "resolution, but we are using the Postscript level %u "
-                   "maximum of %u",
-                   bitsRequiredByMaxval, postscriptLevel, *bitspersampleP);
+    /* There is supposedly a 12 bits per pixel Postscript format, but
+       what?  We produce a raster that is composed of bytes, each
+       coded as a pair of hexadecimal characters and representing 8,
+       4, 2, or 1 pixels.  We also have the RLE format, where some of
+       those bytes are run lengths.
+    */
+
+    if (*bitspersampleP < bitsRequiredByMaxval) {
+        if (bitsRequiredByMaxval <= 12 && postscriptLevel >= 2)
+            pm_message("Maxval of input requires %u bit samples for full "
+                       "resolution, and Postscript level %u is capable "
+                       "of representing that many, but this program "
+                       "doesn't know how.  So we are using %u",
+                       bitsRequiredByMaxval, postscriptLevel, *bitspersampleP);
+        else
+            pm_message("Maxval of input requires %u bit samples for full "
+                       "resolution, but we are using the Postscript level %u "
+                       "maximum of %u",
+                       bitsRequiredByMaxval, postscriptLevel, *bitspersampleP);
+    }
 
     *psMaxvalP = pm_bitstomaxval(*bitspersampleP);
 
diff --git a/doc/HISTORY b/doc/HISTORY
index c2aa622b..18423ea8 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,12 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+07.07.30 BJH  Release 10.35.30
+
+              pnmtops: fix crash when program attempts to write 12 bits per
+              sample Postscript.  It doesn't really know how to do that, so
+              now it just writes 8.
+
 07.07.10 BJH  Release 10.35.29
 
               pnmtopng: Sort palette properly when alpha maxval != 255.