定制 intervention/image-tempest 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

intervention/image-tempest

Composer 安装命令:

composer require intervention/image-tempest

包简介

Tempest framework integration of Intervention Image

README 文档

README

Tempest framework integration for Intervention Image

Latest Version Tests Monthly Downloads Support me on Ko-fi

This package provides an integration to setup Intervention Image easily to your Tempest application with a publishable configuration.

Requirements

  • Tempest >= 3.9

Installation

In your existing Tempest application you can install this package using Composer.

composer require intervention/image-tempest

Features

Although Intervention Image can be used with Tempest without this extension, this integration package includes the following features that make image interaction with the framework much easier.

Application-wide configuration

This integration package comes with a global configuration file that is recognized by Tempest. It is therefore possible to store the settings for Intervention Image once centrally and not have to define them individually each time you call the image manager.

The configuration file can be copied to the application with the following command.

php tempest install image

The call will publish the configuration file image.config.php to your local application. Here you can set the desired driver and its configuration options for Intervention Image.

The configuration files looks like this.

use Intervention\Image\Drivers\Gd\Driver as GdDriver;
use Intervention\Image\Tempest\Config as ImageConfig;

return new ImageConfig(
    /*
    |--------------------------------------------------------------------------
    | Image Driver
    |--------------------------------------------------------------------------
    |
    | Intervention Image supports “GD Library” and “Imagick” to process images
    | internally. Depending on your PHP setup, you can choose one of them.
    |
    | Included options:
    |   - \Intervention\Image\Drivers\Gd\Driver::class
    |   - \Intervention\Image\Drivers\Imagick\Driver::class
    |   - \Intervention\Image\Drivers\Vips\Driver::class
    */

    driver: \Tempest\env('IMAGE_DRIVER', GdDriver::class),

    /*
    |--------------------------------------------------------------------------
    | Configuration Options
    |--------------------------------------------------------------------------
    |
    | These options control the behavior of Intervention Image.
    |
    | - "autoOrientation" controls whether an imported image should be
    |    automatically rotated according to any existing Exif data.
    |
    | - "decodeAnimation" decides whether a possibly animated image is
    |    decoded as such or whether the animation is discarded.
    |
    | - "backgroundColor" Defines the default background & blending color.
    |
    | - "strip" controls if meta data like exif tags should be removed when
    |    encoding images.
    */

    autoOrientation: true,
    decodeAnimation: true,
    backgroundColor: 'ffffff',
    strip: false,
);

You can read more about the different options for driver selection, setting options for auto orientation, decoding animations and background color.

Injecting Dependencies

The following code example shows how to inject an image manager into your controller. The instance has already been automatically configured according to the config file. Of course you are not limited to inject into controller.

use Intervention\Image\Format;
use Intervention\Image\Interfaces\ImageManagerInterface;
use Tempest\Router\Get;
use Tempest\View\View;

use function Tempest\View\view;

final readonly class HomeController
{
    public function __construct(private ImageManagerInterface $imageManager)
    {
        //
    }

    #[Get(uri: '/')]
    public function __invoke(): View
    {
        // process image
        $image = $this->imageManager
            ->decode('./example.jpg')
            ->scale(height: 300)
            ->encodeUsingFormat(Format::WEBP);

        return view('./home.view.php', dataUri: $image->toDataUri());
    }
}

Authors

This library is developed and maintained by Oliver Vogel

Thanks to the community of contributors who have helped to improve this project.

License

Intervention Image Tempest is licensed under the MIT License.

intervention/image-tempest 适用场景与选型建议

intervention/image-tempest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「image」 「thumbnail」 「resize」 「gd」 「imagick」 「watermark」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 intervention/image-tempest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 intervention/image-tempest 我们能提供哪些服务?
定制开发 / 二次开发

基于 intervention/image-tempest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 34
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-18