about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-09-29 14:39:18 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-09-29 14:39:18 +0000
commit06e7ba826fd876237cdc82c7b3554cd8faeac43f (patch)
tree5aafed1d1a3ab99e7acede378e60e6f5e1f73518
parent8e26a1fad535e8942775380842eacd26e8582a95 (diff)
downloadnetpbm-mirror-06e7ba826fd876237cdc82c7b3554cd8faeac43f.tar.gz
netpbm-mirror-06e7ba826fd876237cdc82c7b3554cd8faeac43f.tar.xz
netpbm-mirror-06e7ba826fd876237cdc82c7b3554cd8faeac43f.zip
Fix corrupted images
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1313 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pamtopdbimg.c4
-rw-r--r--converter/other/pdbimgtopam.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/converter/other/pamtopdbimg.c b/converter/other/pamtopdbimg.c
index 66d737fa..6454292e 100644
--- a/converter/other/pamtopdbimg.c
+++ b/converter/other/pamtopdbimg.c
@@ -437,7 +437,7 @@ g16pack(tuple *         const tupleRow,
 
     for (col = 0, off = 0, seg = &outData[0]; col < paddedWidth; ++col) {
         if (col < pamP->width)
-            setg16pixel(*seg, 16 - tupleRow[col][0] * 16 / pamP->maxval, off);
+            setg16pixel(*seg, 15 - tupleRow[col][0] * 15 / pamP->maxval, off);
         else
             /* Pad on the right with white */
             setgpixel(*seg, 0, off);
@@ -468,7 +468,7 @@ gpack(tuple *         const tupleRow,
 
     for (col = 0, off = 0, seg = &outData[0]; col < paddedWidth; ++col) {
         if (col < pamP->width)
-            setgpixel(*seg, 4 - tupleRow[col][0] * 4 / pamP->maxval, off);
+            setgpixel(*seg, 3 - tupleRow[col][0] * 3 / pamP->maxval, off);
         else
             /* Pad on the right with white */
             setgpixel(*seg, 0, off);
diff --git a/converter/other/pdbimgtopam.c b/converter/other/pdbimgtopam.c
index 01fcfb8b..6b7c6008 100644
--- a/converter/other/pdbimgtopam.c
+++ b/converter/other/pdbimgtopam.c
@@ -618,7 +618,7 @@ munpack(const uint8_t * const p,
         uint8_t *       const b,
         int             const w) {
 
-    static const uint8_t pal[] = {0x00, 0x01};
+    static const uint8_t pal[] = {PAM_BW_WHITE, PAM_BLACK};
     const uint8_t * seg;
     unsigned int i;