fix tiff reader to handle TIFFTAG_SAMPLESPERPIXEL for grayscale images
authorLuboš Luňák <l.lunak@suse.cz>
Tue, 7 Sep 2010 10:07:34 +0000 (12:07 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Tue, 14 Sep 2010 13:04:12 +0000 (15:04 +0200)
commitcb6380beb81ab9571c547270c144988781fed465
tree88d2feb9528b3cb3ac5da8cd13b792f8bf77001b
parent84066a357e868b7d3f774f4847840014d3bf9e51
fix tiff reader to handle TIFFTAG_SAMPLESPERPIXEL for grayscale images

This commit fixes reading a .tiff file from ImageMagick which reports
the following:
TIFFTAG_BITSPERSAMPLE = 8
TIFFTAG_SAMPLESPERPIXEL = 2
TIFFTAG_PHOTOMETRIC = PHOTOMETRIC_MINISBLACK
The reader uses QImage::Format_Indexed8, but since the samples per pixel
value this should be (non-existent) QImage::Format_Indexed16, causing
memory corruption. The fix falls back to the "normal" way of reading
tiff images.

Merge-request: 2467
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/image/qtiffhandler.cpp