定制 nickdekruijk/imageresize 二次开发

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

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

nickdekruijk/imageresize

最新稳定版本:1.3.2

Composer 安装命令:

composer require nickdekruijk/imageresize

包简介

A simple, yet efficient solution for image resizing and caching with Laravel

README 文档

README

Latest Stable Version Latest Unstable Version Monthly Downloads Total Downloads License

ImageResize for Laravel

A simple, yet efficient solution for image resizing and caching with Laravel. Based on my previous imageresize package, now renamed to nickdekruijk/imageresize-legacy.

Installation

To install the package use

composer require nickdekruijk/imageresize

Configuration

After installing for the first time publish the config file with

php artisan vendor:publish --tag=config --provider="NickDeKruijk\ImageResize\ServiceProvider"

A default config file called imageresize.php will be available in your Laravel /config folder. See this file for more details.

How does it work

Let's assume you have an image in /public/media/images/test.jpg and a template called thumbnail. And have set the imageresize.route config to media/resized.

Referring to http://domain.com/media/resized/thumbnail/images/test.jpg will trigger the imageresize route in laravel since the file doesn't exist. Imageresize then creates the resized image and saves it as /public/media/resized/thumbnail/images/test.jpg.

So the next time you refer to http://domain.com/media/resized/thumbnail/images/test.jpg the file does exist and the image is served without triggering any php/laravel code for optimal performance.

Drawbacks

There is however one disadvantage: if the original image is edited or removed the resized file will still remain the same since referring to it doesn't trigger the imageresize package. You will have to manually delete it or use the php artisan imageresize:delete command to delete all resized images from the media/resized folder.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-11