inline_image_saver
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
-
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)
-
External image downloading: Downloads images that fail validation during save. Typical cases:
- Images without
data-entity-*attributes - Externally hosted images
data:URI images
- Images without
- Prefer reuse of existing files: Reuses existing files when saving downloaded images with identical content. Supports integration with the File Hash module.
-
Fallback HTML markup: Replaces broken or undownloadable images with configurable HTML markup. Supports token placeholders such as
@src,@alt, and@title. - Revision support: Automatically creates new revisions when replacing or downloading images, with a configurable revision log message.
- Text format targeting: Optionally restricts processing to specific text formats (e.g. "Full HTML", "Basic HTML").
-
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:
Recommended modules/libraries
- Optional integration with the File Hash module for deduplication
Similar projects
- No similar projects found; create an issue to suggest one