canonical / canonicalwebteam.image-template

A python module to generate performant HTML image markup for images
4 stars 7 forks source link

SVG support #4

Open nottrobin opened 5 years ago

nottrobin commented 5 years ago

Mostly, fl_sanitise

jpmartinspt commented 4 years ago

Is this still a thing? @nottrobin @albertkol

nottrobin commented 4 years ago

Ah. That is a little light on detail. I barely remember this. I'd have to spend a second or two looking into how imagetemplate module interacts with SVGs. @Lukewh may know more but unfortunately we can no longer compel him to respond ☺️. Or maybe @barrymcgee ?

sowasred2012 commented 2 years ago

@nottrobin - any luck remembering details on this? We are now both @Lukewh-less and @barrymcgee-less. Could we close?

aaryanporwal commented 1 week ago

Just faced this issue. To reproduce, just pass in the image url of an svg.

Here's my code:

{{ image(url="https://assets.ubuntu.com/v1/9e91caf9-Canonical%20Ubuntu%20Summit%20Logo%202024%20with%20text.svg",
                  alt="Ubuntu Summit 2024 Logo",
                  width="350",
                  height="150",
                  hi_def=True,
                  loading="lazy") | safe }}

See that the image url is valid and opens, but somehow image filter doesn't render the image on the website.

Update: This only happens with some svgs. Like this Canonical Logo svg renders just fine:

            {{ image(url="https://assets.ubuntu.com/v1/d86e845a-Canonical_logo_2023.svg",
                    alt="Canonical",
                    width="104",
                    hi_def=True,
                    loading="lazy") | safe
            }}
albertkol commented 1 week ago

Just fix it, m8! This issue is older than COVID.