]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change double last bit
authorBastian Dehn <hhaalo@arcor.de>
Sat, 1 Feb 2025 10:09:15 +0000 (11:09 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 1 Feb 2025 10:09:15 +0000 (11:09 +0100)
src/kds_s2000w_image_converter_netpbm.c

index 1a6cfa9f525d79bb8e48172c22bae91b38cc28ce..df2a82c19a8ce362b3b49d27c7515afcddc41f7b 100644 (file)
@@ -138,12 +138,14 @@ unsigned char _kds_s2000w_image_converter_mirror_bits(unsigned char data)
 {
        unsigned char tmp = 0;
 
-       for (int i = 0; i < BYTE_BITS; i++) {
+       for (int i = 0; i < BYTE_BITS - 1; i++) {
                tmp += data & 1;
                tmp <<= 1;
                data >>= 1;
        }
 
+       tmp += data;
+
        return tmp;
 }