| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
2006.03.17 22:36 "patch for bmp2tiff", by Mikhail KrukAttached is a patch for bmp2tiff tool which fixes a bug in dealing with BMPs with RLE encodings. In absolute mode the sequence of non-encoded pixels must be word-aligned. Attached is a file which doesn't get properly converted with unpatched bmp2tiff and works with the patch. I only have file to demonstrate it for RLE-4 case but I assumed that RLE-8 works the same way so changed in both places. --- /cygdrive/c/temp/tiff-3.8.1/tools/bmp2tiff.c.orig 2006-03-17 12:55:15.492279300 -0500 +++ /cygdrive/c/temp/tiff-3.8.1/tools/bmp2tiff.c 2006-03-17 12:55:33.008352700 -0500 @@ -635,7 +635,7 @@ runlength = comprbuf[i++]; for (k = 0; k < runlength && j < uncompr_size && i < compr_size; k++) uncomprbuf[j++] = comprbuf[i++]; - if ( k & 0x01 ) + if ( i & 0x01 ) i++; } } @@ -675,7 +675,7 @@ else uncomprbuf[j++] = (comprbuf[i] & 0xF0) >> 4; } - if (k & 0x01) + if (i & 0x01) i++; } } |
|||||||