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 Image Metadata

64 sites Security covered
View on drupal.org

This module extracts metadata like captions and descriptions from image files using IPTC, EXIF, and XMP standards. It automatically maps this data to your media fields, with a fallback to the filename for titles if no other metadata is found. You can also customize the mapping for specific metadata attributes.

This module extracts metadata from image files and maps them to media fields.

Any metadata embedded in images according to the standards:

can be retrieved by this module.

A mapping is provided to make it easier to access the most commonly-used attributes without having to know exactly the code/address of the data in the different standards.

Metadata Attributes Provided

The above table shows the prioritization order for each metadata attribute. For example, when looking for the caption metadata attribute, the module will first look at the 2#120 value (in IPTC data), and if this is empty, it will fall back to dc:description (in XMP data), and finally to ImageDescription (in EXIF data).


Note:

The title attribute will fall back to the filename, if none of the above sources returned a non-empty value.

Retrieving unmapped metadata from images

If your images have metadata embedded in different locations, you can easily alter the above mapping by implementing the hook_media_image_metadata_alter() hook in a custom module, like so:

function foo_media_image_metadata_alter(array &$normalized_metadata, array $raw_metadata) {
  // Use IPTC "Special Instruction" as caption.
  if (!empty($raw_metadata['iptc']['2#40'])) {
    $normalized_metadata['caption'] = $raw_metadata['iptc']['2#40'];
  }
}

Requirements

  • Media module (from core)
  • (Optional) PHP 8.2+ with EXIF extension (only if you need EXIF metadata)

Activity

Total releases
7
First release
Sep 2025
Latest release
7 months ago
Releases (12 mo)
7 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
1.0.6 Stable Nov 27, 2025
1.0.5 Stable Oct 20, 2025
1.0.4 Stable Oct 1, 2025
1.0.3 Stable Sep 26, 2025
1.0.2 Stable Sep 26, 2025
1.0.1 Stable Sep 24, 2025
1.0.x-dev Dev Sep 20, 2025