定制 orzcc/image-laravel 二次开发

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

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

orzcc/image-laravel

最新稳定版本:1.0

Composer 安装命令:

composer require orzcc/image-laravel

包简介

Laravel Integration of Intervention Image

README 文档

README

Laravel Integration for Intervention Image

Latest Version Tests Monthly Downloads

This package provides an integration to setup Intervention Image easily to your Laravel application. Included are a Laravel service provider, facade and a publishable configuration file.

Requirements

  • Laravel >= 8

Installation

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

composer require intervention/image-laravel

Next, add the configuration files to your application using the vendor:publish command:

php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"

This command will publish the configuration file image.php for the image integration to your app/config directory. In this file you can set the desired driver and its configuration options for Intervention Image. By default the library is configured to use GD library for image processing.

The configuration files looks like this.

return [

    /*
    |--------------------------------------------------------------------------
    | 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
    |
    */

    'driver' => \Intervention\Image\Drivers\Gd\Driver::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.
    |
    | - "blendingColor" Defines the default blending color.
    */

    'options' => [
        'autoOrientation' => true,
        'decodeAnimation' => true,
        'blendingColor' => 'ffffff',
    ]
];

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

Getting started

The integration is now complete and it is possible to access the ImageManager via Laravel's facade system.

use Intervention\Image\Laravel\Facades\Image;

Route::get('/', function () {
    $image = Image::read('images/example.jpg');
});

Read the official documentation of Intervention Image for more information.

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 Laravel is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-03