定制 pionix-labs/glu-image 二次开发

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

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

pionix-labs/glu-image

Composer 安装命令:

composer require pionix-labs/glu-image

包简介

Laravel 5 support for glu-image package

README 文档

README

Build Status

pionix-labs\glu-image is a PHP image manipulation helper library.

The package includes ServiceProvider and Facade for easy Laravel 4+ integration.

Note: This package forked and updated for laravel 5 upgrade because of main package is not maintaining anymore!

Purpose

  • The package supports two image manipulation methods: resize and crop.
  • Easily resize and crop jpg, png, and gif images.
  • Supports animated gif using GD Library. (No Imagick, Gmagick is needed).

Dependencies

The package uses:

Requirements

  • PHP >=5.3.3
  • GD Library (>=2.0)

Quick Installation

composer require pionix-labs/glu-image

Laravel Integration

Add Intervention\Image and PionixLabs\GluImage service providers in app/config/app.php.

'providers' => array(

	// ...
	'Intervention\Image\ImageServiceProvider',
	'PionixLabs\GluImage\GluImageServiceProvider',
),

Add GluImage alias in app/config/app.php.

'aliases' => array(

	// ...

	'GluImage' => 'PionixLabs\GluImage\Facades\GluImage',
),

If you want to use Intervention\Image package directly, add InterImage alias in app/config/app.php. This is not a necessary step for using GluImage.

'aliases' => array(

	// ...

	'InterImage' => 'Intervention\Image\Facades\Image',
),

Code Examples

$img = GluImage::get( $path_to_images.'/01.jpg' );
$img->resize(540,360);
$img->save( $path_to_images.'/01-resized.jpg' );

// ...

GluImage::get( $path_to_images.'/01.jpg' )->resize(540,360)->save( $path_to_images.'/01-resized.jpg' );

// ...

GluImage::get( $path_to_images.'/01.jpg' )->crop(540,360)->save( $path_to_images.'/01-cropped.jpg' );

// ...

// one chain creates two different files
GluImage::get( $path_to_images.'/01.jpg' )
	->resize(540,360)
	->save( $path_to_images.'/01-resized1.jpg' )
	->resize(360,220)
	->save( $path_to_images.'/01-resized2.jpg' );

// ...

// chaining another methods after save() method for animated gif files 
// is available only with forked version of GifCreator
GluImage::get( $path_to_images.'/01.gif' )
	->resize(540,360)
	->save( $path_to_images.'/01-resized.gif' )
	->crop(360,220)
	->save( $path_to_images.'/01-resized-and-cropped.gif' );

License

GluImage is licensed under the MIT License.

Copyright 2014 Lukasz Gaszyna

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固