Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

Media Thumbnails

Introduction

Provides a plugin type for custom media entity thumbnails.

This module allows developers to create custom media entity thumbnails using plugins.

That way you can add the media entity 'thumbnail' field to Views or Media entity display modes, optionally add an image style and get preview images e.g. for file types not supported by core thumbnails.

Sample use cases:

  • provide thumbnails for file types unsupported by core, like PDF, SVG, ePub, Word or Excel
  • create variants of thumbnails, e.g. watermarked thumbnails for media entities
  • provide custom generic thumbnails, e.g. configurable in the UI
  • store thumbnails in a custom location, e.g. use public thumbnails for private media entities

Installation

Install this module as usual, and enable at least one thumbnail plugin module. See below for a list of currently existing plugins.

Removal

Uninstall all thumbnail plugin modules. Optionally run the refresh batch operation (see below) to restore the default media thumbnails. At last, uninstall this module.

Configuration

The configuration page (/admin/config/media/thumbnails) allows
specifying a maximum thumbnail width and an optional background color
for plugins supporting it.
There's also a form for running a batch operation for thumbnail regeneration.
Custom plugins might provide their own configuration pages.

API

Plugins can be configured (with annotations) per media file mime type.

Example:

* @MediaThumbnail(
*   id = "media_thumbnail_pdf",
*   label = @Translation("Media Thumbnail PDF"),
*   mime = {
*     "application/pdf"
*   }
* )

The plugin should implement a method createThumbnail($sourceUri).
The uri of the local file (media source) is passed to this method.
The plugin should return a (new or existent) managed thumbnail file object.

All media entity related stuff will be handled by the plugin manager.

Example

The Media Thumbnails PDF module contains
a ready to use plugin. It provides thumbnails for media entities of
mime type application/pdf.

Modules providing thumbnail plugins

Media Thumbnails EPUB
Media Thumbnails Jp2, thanks to Natkeeran
Media Thumbnails PDF
Media Thumbnails SVG
Media Thumbnails Tiff, thanks to Natkeeran
Media Thumbnails Video, thanks to Szczepan Musial

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Sep 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0 Stable Sep 26, 2024