BMP image support for PHP's GD

v1.0.1 2017-03-13 10:09 UTC

This package is auto-updated.

Last update: 2024-04-12 02:49:38 UTC


README

Latest Version on Packagist Software License Total Downloads

Adds BMP image support for PHP's GD functionality.

Install

Via Composer

$ composer require urbanplum/bmp

Usage

require sprintf('%s/../vendor/autoload.php', __DIR__);

$bmp = new Urbanplum\Bmp\Bmp();

// creating a GD resource from a file
$resource = $bmp->createFromFile('/path/to/file.bmp');

// creating a GD resource from a string (e.g. from DB, S3, etc.)
$resource = $bmp->createFromString($bitmapString);

// output image to a browser
header('Content-Type: image/jpeg');
imagejpeg($resource);

// clean up
imagedestroy($resource);

Credits

License

The MIT License (MIT). Please see License File for more information.