intervention/image-driver-vips
Composer 安装命令:
composer require intervention/image-driver-vips
包简介
libvips driver for Intervention Image
README 文档
README
Intervention Image's official driver to use the library with libvips. libvips is a fast, low-memory image processing library that outperforms the standard PHP image extensions GD and Imagick. This package makes it easy to utilize the power of libvips in your project while taking advantage of Intervention Image's user-friendly and easy-to-use API.
Installation
Install this library using Composer. Simply request the package with the following command:
composer require intervention/image-driver-vips
Getting Started
The public API of Intervention Image can be
used unchanged. The only configuration that needs to be done is to ensure that
Intervention\Image\Drivers\Vips\Driver by this library is used by Intervention\Image\ImageManager.
Code Examples
use Intervention\Image\ImageManager; use Intervention\Image\Drivers\Vips\Driver as VipsDriver; use Intervention\Image\Alignment; use Intervention\Image\Format; // create image manager instance using the desired driver $manager = ImageManager::usingDriver(VipsDriver::class); // read image data from path $image = $manager->decodePath('images/example.webp'); // scale image by height $image->scale(height: 300); // insert a watermark $image->insert('images/watermark.png', alignment: Alignment::BOTTOM_RIGHT); // encode edited image $encoded = $image->encodeUsingFormat(format: Format::JPEG, quality: 65); // save encoded image $encoded->save('images/example.jpg');
Requirements
- PHP >= 8.3
- Foreign Function Interface (FFI) Extension
Caveats
-
Due to the technical characteristics of libvips, it is currently not possible to implement color quantization via
ImageInterface::reduceColors()as intended. However, there is a pull request in libvips that enables this feature and it may be integrated here the future as well. -
With PHP on macOS, font files are not recognized in the
ImageInterface::text()call by default because Quartz as a rendering engine does not allow font files to be loaded at runtime via the fontconfig API. However, setting the environment variablePANGOCAIRO_BACKENDtofontconfighelps here.
Authors
This library was developed by Oliver Vogel and Thomas Picquet.
License
Intervention Image Driver Vips is licensed under the MIT License.
intervention/image-driver-vips 适用场景与选型建议
intervention/image-driver-vips 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 191.1k 次下载、GitHub Stars 达 48, 最近一次更新时间为 2024 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「image」 「libvips」 「vips」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 intervention/image-driver-vips 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 intervention/image-driver-vips 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 intervention/image-driver-vips 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A high-level interface to the libvips image processing library.
libvips adapter for imagine
VIPS driver for Intervention Image.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Stand-alone zoomify tile generator (format Zoomify) for use with OpenSeadragon, OpenLayers and various viewers.
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
统计信息
- 总下载量: 191.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 49
- 点击次数: 28
- 依赖项目数: 9
- 推荐数: 6
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-19