Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

media_thumbnails_svg

938 sites Security covered
View on drupal.org

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
2
First release
Sep 2025
Latest release
4 months ago
Release cadence
69 days
Stability
0% stable

Releases

Version Type Release date
3.0.0-alpha1 Pre-release Dec 5, 2025
3.x-dev Dev Sep 27, 2025