elfsundae / intervention-image

该包已被废弃,不再维护。作者建议使用elfsundae/intervention-image-filters 包。

Intervention Image Filters

3.0.1 2022-07-12 15:04 UTC

This package is auto-updated.

Last update: 2022-07-12 15:06:55 UTC


README

Latest Version on Packagist

intervention/image 提供过滤器。

安装

$ composer require elfsundae/intervention-image-filters

使用方法

use Intervention\Image\ImageManager as Image;
// use Intervention\Image\Facades\Image; // For Laravel
use ElfSundae\Image\Filters\Fit;
use ElfSundae\Image\Filters\Resize;

$image = Image::make($file)
    ->filter(new Resize(300, 400))
    ->save($path);

$image->filter(new Fit(320));
$image->filter(new Fit(320, 400, 'top-left'));
$image->filter(new Fit(320)->upsize(false));

$image->filter(new Resize(300, 600, $aspectRatio = false));
$image->filter(new Resize(300, 600)->aspectRatio(false)->upsize(false));

许可

该包是开源软件,遵循MIT 许可协议