diff options
author | faxguy <faxguy> | 2010-12-15 01:04:34 +0000 |
---|---|---|
committer | faxguy <faxguy> | 2010-12-15 01:04:34 +0000 |
commit | bce7852762cc4b15d6106a543aab0845d5a60566 (patch) | |
tree | 8da656a9440830080d7ce8113866539363c0b678 | |
parent | 6f165635b4a74d50984e5b212ef0b6d9576b8ab9 (diff) | |
download | libtiff-bce7852762cc4b15d6106a543aab0845d5a60566.tar.gz |
* libtiff/tif_dirread.c: tolerate some cases where
FIELD_COLORMAP is missing
http://bugzilla.maptools.org/show_bug.cgi?id=2189
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libtiff/tif_dirread.c | 12 |
2 files changed, 15 insertions, 3 deletions
@@ -1,5 +1,11 @@ 2010-12-14 Lee Howard <faxguy@howardsilvan.com> + * 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 <faxguy@howardsilvan.com> + * libtiff/tif_strip.c: use TIFFGetFieldDefaulted instead of TIFFGetField when we assume that it will succeed http://bugzilla.maptools.org/show_bug.cgi?id=2215 diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 32976dce..9e8b9c5c 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.92.2.13 2010-12-14 02:40:31 faxguy Exp $ */ +/* $Id: tif_dirread.c,v 1.92.2.14 2010-12-15 01:04:34 faxguy Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -643,8 +643,14 @@ TIFFReadDirectory(TIFF* tif) */ if (td->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: |