diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-01-04 21:50:44 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-01-04 21:50:44 (GMT) |
commit | f019f3cf807e3c804bba3ef5598ea69adbb39e8b (patch) | |
tree | 99c172a8c63222abf0e9078e8091dd5acbbbd61e /src/plugins/imageformats | |
parent | 5c2d319ce56fa7914afe52ae13f1a24c03608629 (diff) | |
download | Qt-f019f3cf807e3c804bba3ef5598ea69adbb39e8b.zip Qt-f019f3cf807e3c804bba3ef5598ea69adbb39e8b.tar.gz Qt-f019f3cf807e3c804bba3ef5598ea69adbb39e8b.tar.bz2 |
BitsPerSample should default to 1 in TIFF files.
Task-number: QTBUG-6870
Reviewed-by: Lorn Potter
Diffstat (limited to 'src/plugins/imageformats')
-rw-r--r-- | src/plugins/imageformats/tiff/qtiffhandler.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index 9538745..7ac9722 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) { |