dev-master
9999999-devBatch convert images to data URIs
MIT
The Requires
- php >=7.0
The Development Requires
image jpg base64 uri-generator
v1.0.0
1.0.0.0Batch convert images to data URIs
MIT
The Requires
- php >=7.0
image jpg base64 uri-generator
Wallogit.com
2017 © Pedro Peláez
Batch convert images to data URIs
A simple PHP class for batch convert images to data URI, (*1)
A data URI is a base64 encoded string that represents a file. Getting the contents of a file as a string means that you can directly embed the data within your HTML or CSS code. When the browser encounters a data URI in your code, it’s able to decode the data and construct the original file., (*2)
The main benefit to using data URIs is that you can reduce the number of HTTP requests that your site needs to make to load the page. Each individual file referenced in your CSS or HTML code will create a new HTTP request. By using data URIs, you’re actually embedding the file data directly within your HTML or CSS file, so there’s no need to make a HTTP request to fetch the resource., (*3)
Install Composer if you don't have it., (*4)
composer require geekcom/image-to-uri
Or in your file'composer.json' add:, (*5)
{
"require": {
"geekcom/image_to_uri": "^1.0.0"
}
}
And the just run:, (*6)
composer install
and thats it., (*7)
require __DIR__ . '/src/image2URI.php'; use imageToURI\imageToURI; $images = new imageToURI(); $images->imageToURI(['images/image1.png', 'images/image2.png' ], 'dataUris/dataUris.txt', false);
MIT, (*8)
Batch convert images to data URIs
MIT
image jpg base64 uri-generator
Batch convert images to data URIs
MIT
image jpg base64 uri-generator