Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.7, 5.14.0
-
None
Description
If a TIFF Image in RGBI format (RGB and infrared channel) is loaded in a QImage, QImage::format() returns QImage::Format_ARGB32 and QImage::hasAlphaChannel() returns true.
In my opinion this is not really correct, because the image has no alpha channel. In my case, to handle the image correct, the application must know that the image has no alpha channel.
The TIFFTAG_EXTRASAMPLES in this case is 0 (EXTRASAMPLE_UNSPECIFIED), which, as far as I know, stands for unspecified data. In this case in QTiffHandlerPrivate::readHeaders the format is set to QImage::Format_ARGB32 .
I think there should be a way to check if QImage have an alpha channel or not. For example QImage::hasAlphaChannel() should return false and/or an own format like QImage::Format_XRGB32 is needed, for images like this.
Or if this is not possible, at least it should be a way to get more informations about the image tags over QImage, for example to read the TIFFTAG_EXTRASAMPLES . I didn't find a way to do this with QImage or QImageReader.
Example pictures in TIFF RGBI format can be downloaded here:
https://www.lgl-bw.de/unsere-themen/Produkte/Testdaten/Testdaten-Luftbildprodukte/
I checked thi issue with Qt 5.9.7 and 5.14.0 on Windows 10.