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

All SVGs with paths with more than 32768 points render incorrectly

    XMLWordPrintable

Details

    • All
    • c7328d8f3 (dev), 5ed3c6107 (6.7), 3899c791b (6.6), da1345450 (tqtc/lts-6.5)

    Description

      After QTBUG-96044 was fixed, one of the optimizations made was to abruptly ignore all path components after 32678 points in a single path.

      However, some instances of SVGs easily can have more than 50000, sometimes 100000 points in a single path, especially when using an image trace to turn a complex shape into a vector path.

      If the optimization brought by that bugfix is necessary, it would be great if it could be optionally turned off using an environment variable to enable these more complex use cases of QtSVG and not have to use a third-party library to parse and render SVG data.

      Here's the result of loading a SVG with any build of Qt/PySide6 since 6.2.2:

      Commenting out the lines 1881 and 1882 in qsvghandler.cpp fixes the issue completely:

      Also, find the attached SVG file to reproduce the issue. Loading it will print out the error "qt.svg: Invalid path data; path truncated."

      test.svg

       

      Attachments

        For Gerrit Dashboard: QTBUG-120653
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            virokannas Simo Virokannas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes