koren / inline-images
A lib to handle image inlining in your (css, img src, etc.)
Installs: 351
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/koren/inline-images
Requires
- php: ^5.3.0 || ^7.0
This package is not auto-updated.
Last update: 2025-10-11 23:27:41 UTC
README
A PHP lib to handle image inlining in your (css, img src, etc.)
Install
composer require koren/inline-images
Convert an image to an inline string value
<?php $inliner = new InlineImages\Converter('/path/to/img.png'); echo '<img src="'.$inliner->convert().'"/>'; //or for css echo 'background: url('.$inliner->convert().')';
Convert a remote image to inline string value
<?php $inliner = new InlineImages\Converter('http://path/to/img.png'); echo '<img src="'.$inliner->convert().'"/>'; //or for css echo 'background: url('.$inliner->convert().')';
Inline SVGs
<?php $inliner = new InlineImages\Converter('/path/to/img.svg'); echo '<img src="'.$inliner->convert().'"/>'; //or for css echo 'background: url('.$inliner->convert().')';