intervention/image 图片处理扩展包
2020-5-23
Laravel 扩展包
laravel
图片

https://github.com/Intervention/image (opens new window)

Intervention Image

Intervention Image is a PHP image handling and manipulation library providing an easier and expressive way to create, edit, and compose images. The package includes ServiceProviders and Facades for easy Laravel integration.

Requirements

  • PHP >=5.4
  • Fileinfo Extension

Supported Image Libraries

  • GD Library (>=2.0)
  • Imagick PHP extension (>=6.5.7)

Getting started

Code Examples

// open an image file
$img = Image::make('public/foo.jpg');

// resize image instance
$img->resize(320, 240);

// insert a watermark
$img->insert('public/watermark.png');

// save image in desired format
$img->save('public/bar.jpg');

Refer to the official documentation (opens new window) to learn more about Intervention Image.