PHP GD 的 BMP 图像支持

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

This package is auto-updated.

Last update: 2024-09-12 03:48:50 UTC


README

Latest Version on Packagist Software License Total Downloads

为 PHP GD 功能添加 BMP 图像支持。

安装

通过 Composer

$ composer require urbanplum/bmp

用法

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);

致谢

许可证

MIT 许可证 (MIT)。请参阅 许可证文件 获取更多信息。