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

4.8.0 regression: QTgaHandler::canRead works incorrectly and breaks other plugins (qtjp2imageformat)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.8.2
    • 4.8.0
    • None
    • Linux x86-64, possibly reproducible on any platform
    • Ib58b0458215cf5ad705dffa0aaf6a7463d1f089e

    Description

      TGA format plugin was moved to the main plugins set (compiled and installed by default) from Qt3D module since the 4.8.0 release (see QTBUG-22708). Sadly it broke the things out in our case.

      As mentioned in the QImageIOHandler::canRead documentation: "When reimplementing canRead(), make sure that the I/O device (device()) is left in its original state (e.g., by using peek() rather than read())". The current implementation in QTgaHandler uses QTgaFile class, which by default reads the beginning of file. Sadly the reading implementation moves the QIODevice position from 0 to 18 for every file it reads.

      In our project it broke qtjp2imageformat plugin from Qt Solutions repository. JPEG2000 plugin tries to read the magic number and it doesn't move file position to zero before reading so its canRead() function always returns false on the correct jp2 files when used in Qt 4.8.0.

      I already have a ready-made patch for this problem and will send it tommorow via Gerrit.

      Attachments

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

        Activity

          People

            w00t Robin Burchell
            cyberbobs Boris Moiseev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes