Drupal is a registered trademark of Dries Buytaert

inline_image_saver

5 sites Security covered
View on drupal.org

Prevents loss or breakage of (CKEditor) inline images in text fields by ensuring all images are stored locally and reference file entities. The module scans <img> tags in the markup, validates them, optionally downloads external images, and replaces broken images with fallback HTML markup. Useful when editors paste content with externally hosted or data: URI images.

Supporting this Module ☕

Found this module useful? Support via PayPal.

Features

  1. Image validation: Enforces strict rules on inline images in text fields. Ensures they reference actual file entities (data-entity-* attributes), and optionally verifies:
    • The referenced file exists on the filesystem
    • The MIME type is valid and supported
    • The image URL matches the expected file entity path (host, path, optional query)
  2. External image downloading: Downloads images that fail validation during save. Typical cases:
    • Images without data-entity-* attributes
    • Externally hosted images
    • data: URI images
  3. Prefer reuse of existing files: Reuses existing files when saving downloaded images with identical content. Supports integration with the File Hash module.
  4. Fallback HTML markup: Replaces broken or undownloadable images with configurable HTML markup. Supports token placeholders such as @src, @alt, and @title.
  5. Revision support: Automatically creates new revisions when replacing or downloading images, with a configurable revision log message.
  6. Text format targeting: Optionally restricts processing to specific text formats (e.g. "Full HTML", "Basic HTML").
  7. Sync-safe mode: Skips processing during programmatic entity synchronization (via SynchronizableInterface).

Use cases

  • Editors pasting content with externally hosted or data: URI images
  • Ensuring image files are safely stored and backed up
  • Preventing broken images due to removed or inaccessible external resources
  • Enforcing strict validation in editorial workflows

Post-Installation

After installation, go to /admin/config/content/inline-image-saver/settings and enable the options you need.

Demo

Validation in action:
When a user tries to save a text field with an external image that lacks proper data-entity-type and data-entity-uuid attributes, the module prevents saving and shows a validation error.

Downloading in action:
If automatic downloading is enabled, invalid external images are saved by downloading them and replacing the markup with a valid file entity reference.
Before save:

After save:

  • Optional integration with the File Hash module for deduplication

Similar projects

  • No similar projects found; create an issue to suggest one

Activity

Total releases
3
First release
Jul 2025
Latest release
2 months ago
Release cadence
67 days
Stability
67% stable

Release Timeline

Releases

Version Type Release date
2.0.1 Stable Dec 7, 2025
2.0.0 Stable Jul 28, 2025
2.0.x-dev Dev Jul 27, 2025