承接 yaro/cropp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

yaro/cropp

最新稳定版本:0.1.1

Composer 安装命令:

composer require yaro/cropp

包简介

Image manipulations on-the-fly for Laravel 5

README 文档

README

Laravel 5 package for image manipulations on-the-fly.

Installation

You can install the package through Composer.

composer require yaro/cropp

You must install this service provider.

// Laravel 5: config/app.php
'providers' => [
    //...
    Yaro\Cropp\ServiceProvider::class,
    //...
];

Then publish the config file of the package using artisan.

php artisan vendor:publish --provider="Yaro\Cropp\ServiceProvider"

This package comes with Intervention Image package, so publish its configs too.

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

There is no need to add Intervention Image service provider in 'providers' array.

Usage

Simple wrap ypur image source on cropp function and call api methods.

<img src="{{ cropp('image.jpg')->invert()->fit(320, 200) }}" />
// <img src="http://example.com/storage/cropp/61bb83eae21cb5559fe0c583f14b0374.jpg">

Or not to wrap result on asset:

<img src="{{ cropp('image.jpg', false)->greyscale()->rotate(-45)->resize(500, null) }}" />
// <img src="/storage/cropp/44aead54d338966bca06535d34edc3ae.jpg">

To get generated source path use src method:

$thumbPath = cropp('image.jpg')->invert()->fit(320, 200)->src();

You can also initialise Cropp without helper function:

use Yaro\Cropp\Cropp;

$cropp = new Cropp('image.jpg', false);
$src = $cropp->fit(320, 200)->src(); 
echo $src; // /storage/cropp/44aead54d338966bca06535d34edc3ae.jpg
// or
$src = Cropp::make('image.jpg')->fit(320, 200)->src();
echo $src; // http://example.com/storage/cropp/61bb83eae21cb5559fe0c583f14b0374.jpg

API

All manipulation methods is provided by Intervention Image package.

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-12