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

QImage svg plugin claims to support any gzipped content

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.15, 6.2, 6.5
    • Image formats, SVG Support
    • None

    Description

      Creating QImageReader with a QBuffer containing any gzipped content will lead it to be read by the svg plugin: https://github.com/qt/qtsvg/blob/82909c05b7e2cab3eae86f4de4b562f06f090ea3/src/plugins/imageformats/svg/qsvgiohandler.cpp#L96

      What in turn leads for the following warning to displayed (which is really annoying if application checks whether it can generate a preview for arbitrary data that way and processes a lot of data, that's what I observe): https://github.com/qt/qtsvg/blob/82909c05b7e2cab3eae86f4de4b562f06f090ea3/src/svg/qsvgtinydocument.cpp#L129

      Moreover, this likely creates a problem that any other plugin won't be able to process gzipped data due to this:
      https://github.com/qt/qtbase/blob/b05540bd00d051c74e67d138f5148eb23e018996/src/gui/image/qimagereader.cpp#L326-L331
      https://github.com/qt/qtsvg/blob/82909c05b7e2cab3eae86f4de4b562f06f090ea3/src/plugins/imageformats/svg/main.cpp#L42

      I believe it should try to partially decompress it to read those first 16 bytes before claiming it can read the data.

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            ilya-fedin Ilya Fedin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes