Media library grid view showing Remote images
Media Remote Image settings
Image URL settings for Remote image

This project is not covered by Drupal’s security advisory policy.

Media Remote Image provides a Remote image media type for embedding images that are hosted at external URLs, without requiring the original image files to be stored in Drupal.

The module is useful when you want Drupal media entities for images hosted elsewhere. Remote images are rendered as standard image elements using the saved image URL or path.

Features

  • Provides a Remote image media source and default Remote image media type.
  • Supports external image URLs and internal image paths.
  • Supports common web image formats including JPEG, PNG, GIF, SVG, TIFF, WebP, and AVIF.
  • Can generate local thumbnail previews for media administration and Media Library workflows.
  • Supports ALT text for remote images.
  • Supports multiple images within a single media entity.
  • Provides formatter settings for maximum display width and height.
  • Provides formatter settings for lazy/eager image loading and image linking.
  • Shows image previews on saved Remote image edit forms.
  • Validates remote images using HTTP response metadata and image content.

Example use cases

  • Embedding images hosted on external sites or image libraries, such as Wikimedia Commons, Flickr, or Pexels.
  • Serving images directly from a CDN.
  • Creating Drupal media entities for remote images so they can be managed, referenced, searched, displayed, and reused like other media.
  • Supporting workflows where media metadata, licensing, attribution, or taxonomy fields are managed in Drupal while the original image remains remotely hosted.
  • Using remote image media when leveraging the Deploy module suite in conjunction with Relaxed deployment.

Post-installation

  • Use the included Remote image media type, or create an additional media type using the Remote image media source.
  • Configure the module settings at Configuration > Media > Media Remote Image settings. Enable Generate thumbnail previews if you want Drupal to create local thumbnail previews when remote image media entities are saved.
  • If you want editors to enter media names manually, enable the Name field on the Remote image media type's Manage form display page.

Additional requirements

  • Requires the Drupal core Media module.
  • Requires the Drupal core Link module.
  • No external PHP libraries are required.
  • Thumbnail generation requires the remote image to be reachable by the Drupal site and processable by the configured image toolkit.
  • AVIF thumbnail generation depends on support in the Drupal image toolkit and the underlying PHP/image library stack.

Important limitations

Because the original remote image is not copied into Drupal's local file system, Drupal core image styles cannot be applied to the full remote image in the same way as they can for local image media.

If you need Drupal image styles for the original image file, consider using Remote Stream Wrapper, which can copy remote files into Drupal and expose them as local files.

Similar projects

Hotlinking, licensing, and reliability

Many image hosting sites do not permit their images to be embedded on external sites, either in their terms of service or by substituting a placeholder image for the requested image. Some hosts only permit hotlinking in limited contexts, and some require specific backlinks or attribution.

It is your responsibility to make sure that you are abiding by any third-party requirements, licenses, copyrights, and terms of service.

Please also be considerate of the remote host. If you have appropriate rights, consider hosting the image on your own server or another suitable image hosting service. This can also make your site more reliable, because externally hosted images may change, move, or go offline.

Roadmap

Development is ongoing. Features currently under consideration include:

  1. Extract metadata from remote images for use in field mapping, such as name, MIME type, file size, width, and height.
  2. Consider additional remote image formatter options, such as explicit width/height attributes, CSS class settings, and responsive image behavior.
  3. Colorbox support and/or other gallery/lightbox support.
Supporting organizations: 
Development

Project information

Releases