承接 kwaadpepper/image-resizer 相关项目开发

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

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

kwaadpepper/image-resizer

最新稳定版本:3.1.1

Composer 安装命令:

composer require kwaadpepper/image-resizer

包简介

Resize images on the fly and cache them

README 文档

README

Latest Version on Packagist Total Downloads Build Status StyleCI

Resizes an image on the fly and returns the new link

Installation

Via Composer

composer require kwaadpepper/image-resizer

Usage

1 - Publish config

php artisan vendor:publish --provider="Kwaadpepper\ImageResizer\ImageResizerServiceProvider"

2 - Set a config in templates array (config/image-resizer.php)

/**
 *   resize => will resize the image (boolean)
 *   fit => Combine cropping and resizing to format image in a smart way (boolean)
 *   keepRatio => will keep image ratio wile resizing (boolean)
 *   trim => boolean to trim the image using border color
 *   inCanvas => to make sure image boundarie is respected
 *   format => select tha wantd ouput form, yan can just convert images if you want
 */
'templates' => [
    'smallWebp' => [
        'height' => 500,
        'width' => 250,
        'inCanvas' => true,
        'format' => 'webp',
        'trim' => ['transparent', null, 10]
    ]
]

3 - type in console php artisan storage:link

4 - in your blade template override an image link

<img src="{{ asset(resize('images/volaillesfr_landing.png', 'smallWebp')) }}" alt="My resized image">

5 - Optional You can clean manually outdated cache file using command php artisan image-resizer:clean-cache or force cleaning the cache using php artisan cache:clean

  • Please Note that is automatically scheduled on production every half hour

Change log

Please see the changelog for more information on what has changed recently.

Testing

composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email github@jeremydev.ovh instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-24