Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81118

QImage Alpha Channel for TIFF files not correct for RGBI files

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.9.7, 5.14.0
    • Image formats
    • None
    • Windows

    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/

      https://www.lgl-bw.de/export/sites/lgl/unsere-themen/Produkte/Testdaten/Galerien/Dokumente/DOP_10cm_RGBI_UTM_TIF.zip

      I checked thi issue with Qt 5.9.7 and 5.14.0 on Windows 10.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            blgis Bernd Lachner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes