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

SVG icons with with <DOCTYPE svg> not loading

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11, Windows
    • 2f63ddc6afeb3d2c3c7a42add0129547acd61ede (qt/qtsvg/dev) fab0ed9a65a451d9a7a3b7ac617a0abc3176049a (qt/qtsvg/5.12) 7dce014c1469f77728bf1ac04b47b9d555189184 (qt/qtsvg/5.15)

    Description

      Hello,

       

      While using a popular icon theme, Breeze from KDE. A few svg icons like "edit-copy" wouldn't load.

       

      The QML is :

       

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
              Button {
                  icon.source: "qrc:/edit-copy.svg"
      
              }
      

      The same with icon.name

      The error is :

       

       

      file:///home/cyril/Devel/Qt/5.15.1/gcc_64/qml/QtQuick/Controls.2/Material/ToolButton.qml: QML IconImage: Error decoding: file:///usr/share/icons/breeze/actions/24/document-close.svg: Format d'image non supporté

      "Format d'image non supporté" is french for "unsupported image format"

      After comparing the source file with another working icon, I found this header breaking the SVG :

       

      <DOCTYPE svg>
      

       

       

      As a workaround, I can copy the whole Breeze theme and strip all icon files of this line.

      Couldn't the SVG parser ignore this header ?

      If not, is it an error from KDE ?

       

      You will find a quick test project as attachment.

       

      Thank you for your time

       

       

       

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            skrib Cyril Jacquet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes