Module Description
This module adds a Field Formatter for an Image field, which let's you implement base64 of the image directly.

While most of the code comes from the core module image's ImageFormatter.php, some rewriting with templating has been done. Should be stable.

Usage
(1) After installation of this module you will get a new format type "Image Base64" you can assign to any Image Field in a Content Type. Just go to the Type's "Manage Display" and choose "Image Base64" instead of "Image" from the Format Combo-Box. (see the attachment screenshot)

(2) Same goes for Image Content Fields in Views, choose "Image Base64" as formatter.

Now the image is base64 encoded in the chosen form will be returned as <img src="data:image/jpeg;base64,..."> instead of the <img src="path/filename.xxx"> tag.

(3) Also working well as Restful API (JSON & GraphQL) service, return the entire image base64 encoded, and you can directly use outside of your decoupled drupal application.

Features
Image Base64 Formatter "Manage Display" options:

(1) Base64 String: raw base64 encrypted image (string).

(2) Image Source: image will be shown as <img src="data:image/jpeg;base64,...">

(3) CSS background Source: show the image as url('data:image/jpeg;base64,...') for CSS background or other related usage.

It is pleasure to serve your images as base64 encode!

Project Usage
222
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module solves the problem of implementing base64 encoding for images in Drupal, allowing for easy display and usage in various formats and contexts.
Data Name
image_base64_formatter

OPENAI CHATBOT

OPENAI CHATBOT

14:24:46
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.