Image Embedder

finds images in your html document, encodes them and embeds them back into the document

Download as .zip Download as .tar.gz View on GitHub

Image Embedder

Image Embedder is a php shell utility that will search your HTML/xHTML document for image files and embed the ones that are less than 50kb back into the html document. Nothing will be deleted, your input files will be backed up as an .old file so you can always reverse the process later if it doesn't work out for you.

help menu

$ php site_scanner.php --help

Scan Directory

$ php site_scanner.php --scan

Scan File

$ php site_scanner.php file.html [max file size]

When you need to send an HTML page to somebody, it may be a complicated process if it uses images or other resources as external files. In that case all the external resources need to be bundled with the main HTML page.

This class implements an alternative solution to avoid needing to bundle external files as separate files.

It replaces all image tags with data URLs that contain the actual image data embedded in the same HTML document, so the images no longer need to be retrieved from separate files.

Manuel Lemos

View Karl Holz's profile on LinkedIn