about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-11 18:17:05 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-11 18:17:05 +0000
commit32b7573e893d62b970ec746de17bd63608437cdd (patch)
tree4af017b15fa767c97f5693e70085eadf0a0f5faf
parent62ee2845e8eb1c42ba1935ecaeb015f14cd4700a (diff)
downloadnetpbm-mirror-32b7573e893d62b970ec746de17bd63608437cdd.tar.gz
netpbm-mirror-32b7573e893d62b970ec746de17bd63608437cdd.tar.xz
netpbm-mirror-32b7573e893d62b970ec746de17bd63608437cdd.zip
Fix bug: bits of a byte taken in wrong order
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4866 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/infotopam.c16
-rw-r--r--doc/HISTORY4
2 files changed, 12 insertions, 8 deletions
diff --git a/converter/other/infotopam.c b/converter/other/infotopam.c
index 24c4d776..3467891c 100644
--- a/converter/other/infotopam.c
+++ b/converter/other/infotopam.c
@@ -301,14 +301,14 @@ addBitplane(unsigned char * const icon,
     unsigned int j;
 
     for (i = j = 0; i < bpsize; ++i, j += 8) {
-        icon[j+0] = (icon[j+0] << 1) | ((buff[i] >> 0) & 0x01);
-        icon[j+1] = (icon[j+1] << 1) | ((buff[i] >> 1) & 0x01);
-        icon[j+2] = (icon[j+2] << 1) | ((buff[i] >> 2) & 0x01);
-        icon[j+3] = (icon[j+3] << 1) | ((buff[i] >> 3) & 0x01);
-        icon[j+4] = (icon[j+4] << 1) | ((buff[i] >> 4) & 0x01);
-        icon[j+5] = (icon[j+5] << 1) | ((buff[i] >> 5) & 0x01);
-        icon[j+6] = (icon[j+6] << 1) | ((buff[i] >> 6) & 0x01);
-        icon[j+7] = (icon[j+7] << 1) | ((buff[i] >> 7) & 0x01);
+        icon[j+0] = (icon[j+0] << 1) | ((buff[i] >> 7) & 0x01);
+        icon[j+1] = (icon[j+1] << 1) | ((buff[i] >> 6) & 0x01);
+        icon[j+2] = (icon[j+2] << 1) | ((buff[i] >> 5) & 0x01);
+        icon[j+3] = (icon[j+3] << 1) | ((buff[i] >> 4) & 0x01);
+        icon[j+4] = (icon[j+4] << 1) | ((buff[i] >> 3) & 0x01);
+        icon[j+5] = (icon[j+5] << 1) | ((buff[i] >> 2) & 0x01);
+        icon[j+6] = (icon[j+6] << 1) | ((buff[i] >> 1) & 0x01);
+        icon[j+7] = (icon[j+7] << 1) | ((buff[i] >> 0) & 0x01);
     }
 }
 
diff --git a/doc/HISTORY b/doc/HISTORY
index e7525682..fee33239 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -20,6 +20,10 @@ not yet  BJH  Release 11.06.00
               ppmtowinicon: fix array overrun with 4 and 8 bits per pixel.
               Broken in Netpbm 11.05 (December 2023).
 
+              infotopam: fix incorrect output -- columns always in wrong
+              place.  Always broken.  (infotopam was new in Netpbm 10.22 (May
+              2004)).
+
               pamseq: fix typo in error message.
 
               build: makeman: fix warning about backslashes in strings.