diff --git a/ChangeLog b/ChangeLog index 0147cc94..3765cef1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-14 Lee Howard + + * libtiff/tif_dirread.c: tolerate some cases where + FIELD_COLORMAP is missing + http://bugzilla.maptools.org/show_bug.cgi?id=2189 + 2010-12-14 Lee Howard * libtiff/tif_read.c: change read_ahead to tmsize_t diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index fba14a23..fc29da82 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.164 2010-12-14 03:03:24 faxguy Exp $ */ +/* $Id: tif_dirread.c,v 1.165 2010-12-15 01:05:02 faxguy Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -3845,8 +3845,14 @@ TIFFReadDirectory(TIFF* tif) */ if (tif->tif_dir.td_photometric == PHOTOMETRIC_PALETTE && !TIFFFieldSet(tif, FIELD_COLORMAP)) { - MissingRequired(tif, "Colormap"); - goto bad; + if ( tif->tif_dir.td_bitspersample>=8 && tif->tif_dir.td_samplesperpixel==3) + tif->tif_dir.td_photometric = PHOTOMETRIC_RGB; + else if (tif->tif_dir.td_bitspersample>=8) + tif->tif_dir.td_photometric = PHOTOMETRIC_MINISBLACK; + else { + MissingRequired(tif, "Colormap"); + goto bad; + } } /* * OJPEG hack: