Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Media Compressor

No security coverage Under active development 1 sites

This module automatically reduces the size of uploaded image and image-only PDF files within Webform submissions. It optimizes images by resizing, re-encoding, and removing metadata, and rebuilds PDFs using compressed images, while leaving other file types unchanged. Files are only replaced if the compression results in a significant size reduction.

Opt-in reduction of image and scanned (image-only) PDF uploads on Webform file elements, for Drupal 11.3+ and Webform 6.3

Users/Customers often scan paperwork on a multi-function device (MFD) with "Scan to PDF", or upload phone photos. Both routinely produce 3-30 MB files. This module shrinks those files at upload time, before Drupal stores them, so every downstream consumer (submission storage, emails, handlers, exports) gets the smaller file.

What it does

JPEG / PNG / WebP:

  • Rotated upright (EXIF orientation)
  • resized to fit 2000 × 2000 px (default)
  • re-encoded in the **same format**
  • All metadata (GPS, camera serials) is removed
  • Compression options configurable
  • There is an option to convert images to JPEG, but that is documented individually

PDF, where every page is exactly one full-page JPEG or 8-bit raster image, and nothing else:
Rebuilt as a new PDF with the same page count, order, size and rotation

  • each page image down-sampled to 150 dpi (default)
  • JPEG quality 70
  • Compression options configurable

Anything else (Word, Excel, GIF, TIFF, born-digital PDFs, OCR'd/searchable PDFs, PDFs with forms, links, attachments, scripts, signatures, encryption, CMYK or black-and-white CCITT/JBIG2 scans, etc.)

  • Left untouched

The file is only replaced if the result is at least 10% smaller (default).
The file name, extension and MIME type never change.

Typical results from testing (see the security review for the full test set):
Test file - Before - After
3-page colour A4 scan @ 300 dpi (JPEG) - 8.2 MB - 0.77 MB
1-page A4 scan @ 300 dpi (lossless / Flate) - 10.2 MB - 0.26 MB
12 MP phone photo - 5.8 MB - 0.34 MB

Drupal 11 · not 10 PHP >=8.3

Ask your assistant about Media Compressor

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Sep 2026
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.1 Stable 11 PHP >=8.3 Sep 19, 2026
1.0.0 Stable 11 PHP >=8.3 Sep 19, 2026