SVG images do not display in the media browser

Created on 7 May 2025, 5 days ago

Problem/Motivation

It is not possible to apply an image style to an SVG image however the images in the media browser apply the "thumbnail" view mode which applies an image style for "thumbnail".

This is a problem for image formats like SVG which are vector based and do not need or cannot be image processed in the same way as bitmap type image formats are.

I'm thinking this could be fixed with a preprocess for image type and a special twig for the thumbnail format. However there's likely better ideas out there, just focused on the most common issue out of the box which would be thumbnail since that affects the media browser.

Steps to reproduce

Install WxT 6.1.x or WxT 5.4.x

Add an SVG image as a media image

Open the media browser, try and find it, notice the image is not rendered.

Proposed resolution

There's possibly a few solutions, perhaps even a core patch which would skip all image processing for svg and just return the original image. However otherwise, a preprocess for image type and a doctored twig for the thumbnail image view mode

Remaining tasks

Review possible solutions

User interface changes

TBD

API changes

TBD

Data model changes

N/A

🐛 Bug report
Status

Active

Version

6.1

Component

Code

Created by

🇨🇦Canada joseph.olstad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024