Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Crop Media On Upload

No security coverage Under active development 10 sites

Part of the Crop ecosystem · 5 projects

This module automatically creates separate media entities for different crop selections made during image upload, streamlining the process of generating various aspect ratios or sized versions of an image. It allows users to upload a single image and define crops using the Image Crop Widget to generate multiple media entities for each variation.

Automatically generate separate media entities for different crop selections defined during the initial image upload.

Introduction:

Crop Media on Upload streamlines the editorial workflow for sites requiring multiple aspect ratios (e.g., Square, Hero, Portrait) for a single image asset. It can also be used to resize images to a defined size(s) on upload too.

While the use of Image Styles will cover many scenarios, based on a single source image, some projects may require more specific targeting of the cropping/resizing of images and, potentially, multiple different shapes and sizes of an image for different uses.

Traditionally, this would mean using third-party image editing tools first to create the correct size/shape images and then having to upload each one to your Drupal site as its own Media entity.

This module allows users to upload a single original image, define their crop shapes (and, optionally, specific sizes) and then use the ImageCropWidget module to define the different crops on upload. It then automatically handles the creation of independent media entities for each crop/size variation.

Key Features:

  • Automatic Multi-Crop Generation: Creates new, separate media entities for every defined and selected crop type (e.g., Square, 16:9, Portrait) immediately upon upload.
  • Resize on upload: Optionally set fixed sizes for your generated crop versions, including multiple sizes per crop style.

How it Works:

  • Configure: Set which of your image-based Media type(s) you wish to use the functionality on and select which Crop Types (from the Crop API) should be enabled for that bundle.
  • Upload: When a user uploads an image to a configured Media type, they are presented with the selected cropping tools.
  • Process: Upon saving, the module generates a unique, cropped image file for every selection and creates a new Media entity for each, using the original title plus the crop label (e.g., "My Image - Square"). Users can choose whether to also keep the original image or just retain the cropped versions.

Requirements:

Installation & Configuration:

  • Install the module as usual via Composer.
  • Set up your crop types via /admin/config/media/crop
  • Navigate to /admin/config/media/crop-media-on-upload.
  • Select the Media types you wish to enable.
  • Map the image field and select the desired crop styles for each type.
  • (Optional) Set a fixed size/sizes for the crop image to be resized to after cropping.
  • (Optional) Set a global suffix for original images or enable the "Don't keep the original image" setting for specific bundles.

Note for Administrators: This module dynamically manages the form display for configured image fields. While active, manual changes to the widget type for those fields in the "Manage Form Display" tab will be overridden to ensure consistent functionality.

Drupal 10–11

Ask your assistant about Crop Media On Upload

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

  • crop Drupal core
  • image_widget_crop Drupal core
  • media Drupal core
  • media_library Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Apr 2026
Latest release
5 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.2 Stable 10–11 Apr 16, 2026
1.0.1 Stable 10–11 Apr 16, 2026
1.0.0 Stable 10–11 Apr 15, 2026