[Qgis-user] Problems with custom SVG images when transfering a project to another computer

Bernhard Seckinger bernhard.seckinger at bueffee.de
Tue Feb 25 03:58:43 PST 2025


Hi Jürgen,

>On Tue, 25. Feb 2025 at 10:04:54 +0100, Bernhard Seckinger via QGIS-User
>wrote:
>> I wonder if conversion to base64 is enough to embed the symbol in the
>> project file? My feeling says it isn't. Does anyone has some experience
>> here?
>
>symlayer = layer.renderer().rootRule().children()[0].symbol().symbolLayer(0)
>f = QFile(symlayer.path())
>f.open(QIODevice.ReadOnly):
>symlayer.setPath("base64:" + f.readAll().toBase64().data().decode("utf-8"))
>f.close()

Great! That works! :-) Many thanks to you and to Stefan!

Bernhard

--
Bernhard Seckinger <bernhard.seckinger at bueffee.de>


More information about the QGIS-User mailing list