From 5054f5d5f3b672c997a649acd1203f61c6742dd6 Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:13:00 +0300 Subject: [PATCH] Fix svg icons display issue in plugin list and plugin detail (#348) --- .../plugins/templates/plugins/plugin_detail.html | 13 ++++++++++--- qgis-app/plugins/templates/plugins/plugin_list.html | 13 ++++++++++--- qgis-app/plugins/templatetags/plugin_utils.py | 4 ++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/qgis-app/plugins/templates/plugins/plugin_detail.html b/qgis-app/plugins/templates/plugins/plugin_detail.html index 101b8194..82ac70c9 100644 --- a/qgis-app/plugins/templates/plugins/plugin_detail.html +++ b/qgis-app/plugins/templates/plugins/plugin_detail.html @@ -1,5 +1,6 @@ {% extends 'plugins/plugin_base.html' %}{% load i18n static thumbnail %} {% load local_timezone %} +{% load plugin_utils %} {% block extrajs %} {{ block.super }} @@ -144,9 +145,15 @@

{% endif %}

{{ object.name }} {% if object.icon and object.icon.file %} - {% thumbnail object.icon "128x128" upscale=False format="PNG" as im %} - {% trans - {% endthumbnail %} + {% with image_extension=object.icon.name|file_extension %} + {% if image_extension == 'svg' %} + {% trans + {% else %} + {% thumbnail object.icon "128x128" upscale=False format="PNG" as im %} + {% trans + {% endthumbnail %} + {% endif %} + {% endwith %} {% endif %}

diff --git a/qgis-app/plugins/templates/plugins/plugin_list.html b/qgis-app/plugins/templates/plugins/plugin_list.html index c959d4f8..788053d6 100644 --- a/qgis-app/plugins/templates/plugins/plugin_list.html +++ b/qgis-app/plugins/templates/plugins/plugin_list.html @@ -1,5 +1,6 @@ {% extends 'plugins/plugin_base.html' %}{% load i18n bootstrap_pagination humanize static sort_anchor range_filter thumbnail %} {% load local_timezone %} +{% load plugin_utils %} {% block extrajs %}