summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-01-05 07:50:44 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-01-05 07:50:44 +1000
commitf019f3cf807e3c804bba3ef5598ea69adbb39e8b (patch)
tree99c172a8c63222abf0e9078e8091dd5acbbbd61e
parent5c2d319ce56fa7914afe52ae13f1a24c03608629 (diff)
downloadqt4-tools-f019f3cf807e3c804bba3ef5598ea69adbb39e8b.tar.gz
BitsPerSample should default to 1 in TIFF files.
Task-number: QTBUG-6870 Reviewed-by: Lorn Potter
-rw-r--r--src/plugins/imageformats/tiff/qtiffhandler.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp
index 9538745293..7ac9722fe0 100644
--- a/src/plugins/imageformats/tiff/qtiffhandler.cpp
+++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp
@@ -192,11 +192,10 @@ bool QTiffHandler::read(QImage *image)
return false;
}
+ // BitsPerSample defaults to 1 according to the TIFF spec.
uint16 bitPerSample;
- if (!TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bitPerSample)) {
- TIFFClose(tiff);
- return false;
- }
+ if (!TIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bitPerSample))
+ bitPerSample = 1;
bool grayscale = photometric == PHOTOMETRIC_MINISBLACK || photometric == PHOTOMETRIC_MINISWHITE;
if (grayscale && bitPerSample == 1) {