定制 le0daniel/laravel-image-engine 二次开发

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

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

le0daniel/laravel-image-engine

Composer 安装命令:

composer require le0daniel/laravel-image-engine

包简介

Integration of automatic image manipulation and serving

README 文档

README

Tests

Powerful Image engine for Laravel. Don't waste your time, writing logic to resize and transform images.

Installation

composer require le0daniel/laravel-image-engine

After that, publish the configuration file using

artisan vendor:publish

Configuration

Configure the desired file sizes your application should provide in your configuration file.

Make sure all the required paths exist within your image-engine.php configuration file.

Usage

The image engine is based on the ImageRepresentation class.

use Carbon\Carbon;use le0daniel\Laravel\ImageEngine\Image\ImageRepresentation;

$image = ImageRepresentation::from(
    'file/path/relative/to/disk',
    'medium', // Desired image size defined in config
    null,     // Expire Timestamp or Carbon
    'local'   // name of the storage disk where the image is located
);

$imgUrl = image_url($image, 'png' /* Desired output format: jpg | png */);

This will generate an Image URL for you, which is signed. The image is only converted on demand, as soon as the first request is made to this url. The Image will be converted by Intervention Image to the specified format.

For better performance, the images are stored in the public folder. This enables nginx to serve the files once they have been generated. If the Image has an expirey date, the image is stored in the defined path from your config. In this case, php will serve the image, even tho it has been cached.

If you need a file for local processing (Ex: send in an email), simply use:

image_real_path($image, 'png');

This will return the local path of the converted image for you.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固