[BZ#2271] multi-band 1-bit CCITT-compressed TIFFs write incorrectly

Submitted by osoong+maptools at gmail dot com on 2010-11-12 15:50

Link to original bug (#2271)

Description

Created an attachment (id=423) 2-band 1-bit uncompressed tiff test

I've arrived here after following dependencies in R & rgdal, through GDAL. My apologies if this seems familiar to anybody.

I've attached a test tif (2bands1bitlt.tif), which is a 2-band 1-bit uncompressed TIFF. I run tiffcp:

tiffcp -c g4 2bands1bitlt.tif 2bands1bitltg4.tif
tiffcp -c none 2bands1bitltg4.tif 2bands1bitltnone.tif

The uncompressed files differ:

tiffcmp 2bands1bitlt.tif 2bands1bitltnone.tif

I can examine the files using R & rgdal, and the compressed version (2bands1bitltg4.tif) is the left half of the full version (i.e., the right half is all 0). The error is then unsurprisingly propagated into 2bands1bitltnone.tif.

This is with libtiff-3.9.4 on Red Hat 3.4.2-6.fc3.

Attachment 423, "2-band 1-bit uncompressed tiff test":
2bands1bitlt.tif

Attachment 424, "3 band example":
3bands1bitlt.tif

Edited by Thomas Bernard