From 36aed33b337bd24b4a0491389f8e9dc27ffb058c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Fri, 18 Jul 2014 16:01:45 +0200 Subject: allow 1-bit colormaps for TIFF images The TIFF specification seems to only allow for 4-bit and 8-bit colormaps. However at least Microsoft's XPS viewer also accepts 1-bit colormaps and our current code handles this case already anyway. See https://code.google.com/p/sumatrapdf/issues/detail?id=2562 for a sample document. --- source/fitz/load-tiff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/fitz') diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c index a9325f18..52df3de3 100644 --- a/source/fitz/load-tiff.c +++ b/source/fitz/load-tiff.c @@ -291,7 +291,7 @@ fz_expand_tiff_colormap(struct tiff *tiff) if (tiff->samplesperpixel != 1 && tiff->samplesperpixel != 2) fz_throw(tiff->ctx, FZ_ERROR_GENERIC, "invalid number of samples for RGBPal"); - if (tiff->bitspersample != 4 && tiff->bitspersample != 8) + if (tiff->bitspersample != 1 && tiff->bitspersample != 4 && tiff->bitspersample != 8) fz_throw(tiff->ctx, FZ_ERROR_GENERIC, "invalid number of bits for RGBPal"); if (tiff->colormaplen < (unsigned)maxval * 3) -- cgit v1.2.3