Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Media Thumbnails SVG

1,271 sites Security covered
View on drupal.org

This module generates PNG thumbnails for SVG media files, allowing them to be displayed in views and media displays with optional image styles. It converts SVGs to PNGs using tools like GraphicsMagick, ImageMagick, or PHP GD, with a default priority given to GraphicsMagick.


Introduction
This module uses the Media Thumbnails framework to create media entity thumbnails for svg files. That way you can add the media entity 'thumbnail' field to Views or Media entity display modes, optionally add an image style and get png preview images for svg files.
Installation
Install this module as usual, using Composer. Then add a media entity type supporting svg uploads, or add the 'svg' extension to the preinstalled 'document' media type's upload field. Now you'll be able to upload svg files to media entities and create thumbnails for them. The general configuration page (/admin/config/media/thumbnails) allows specifying a maximum thumbnail width and an optional background color.
How does it work?
The module takes a svg file and converts it to a png file, using the configured width and background color. This file will be used as media thumbnail image. The module supports the mime types 'image/svg' and 'image/svg+xml'.
Converting svg files to png bitmap images requires a rasterizer. Currently the following tools are supported, in this order:

GraphicsMagick CLI-Tool (if installed)
This tool usually provides the best quality, but isn't preinstalled in most hosting environments. If your hosting provider or you are able to install additional packages, look for the "graphicsmagick" package. The php extension is not required.


ImageMagick CLI-Tool (if installed)
ImageMagick will be preinstalled in many environments. It's internal rasterizer has limited capabilities, but the quality might be better if it's compiled against RSVG, or Inkscape happens to be installed (ImageMagick will use those rasterizers where possible). Try it out, it might suffice your requirements. The php extension is not required.


PHP GD extension using meyfa/php-svg library
PHP GD is a core requirement, so it's always available. But it has very limited support for rasterizing svg. Basic files will work, but there's no support for advanced features like css. That said, go for ImageMagick or GraphicsMagick!

The rasterizer giving the best results will be chosen automatically. Priority is GraphicsMagick (best quality), then ImageMagick and at last PHP GD (lowest quality).

Activity

Total releases
4
First release
Sep 2025
Latest release
1 month ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
3.0.0-beta1 Pre-release Jun 17, 2026
2.0.1 Stable Jun 17, 2026
3.0.0-alpha1 Pre-release Dec 5, 2025
3.x-dev Dev Sep 27, 2025