summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-01-04 21:50:44 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-01-07 10:35:59 (GMT)
commite0c7d3a4561b23fc548471f910534f0fb57850ab (patch)
treea3e0b26e4f3a7e541ba377960258296a2910b019 /src
parent5bd804dbe13061b95c992d40b2cdce766e6a078d (diff)
downloadQt-e0c7d3a4561b23fc548471f910534f0fb57850ab.zip
Qt-e0c7d3a4561b23fc548471f910534f0fb57850ab.tar.gz
Qt-e0c7d3a4561b23fc548471f910534f0fb57850ab.tar.bz2
BitsPerSample should default to 1 in TIFF files.
Task-number: QTBUG-6870 Reviewed-by: Lorn Potter (cherry picked from commit f019f3cf807e3c804bba3ef5598ea69adbb39e8b)
Diffstat (limited to 'src')
-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 62781af..cedd5d9 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) {