jscustom/laravel-image-resize 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jscustom/laravel-image-resize

最新稳定版本:2.0.0

Composer 安装命令:

composer require jscustom/laravel-image-resize

包简介

Laravel package for resizing images. Supports PNG, JPG, JPEG, GIF.

README 文档

README

Laravel package for resizing images. Supports PNG, JPG, JPEG, GIF.

Table of Contents

Getting Started
Installation
How to Use
Download Postman API
Image Resize
Sample Image Resize API
How To Implement Image Resize Service
Common Issues Encountered
Support

Getting Started

Below are the steps in order to integrate image resize API to your Laravel project.

Installation

Install the package using composer:

composer require jscustom/laravel-image-resize

Export the configuration file:

php artisan vendor:publish --provider="JSCustom\ImageResize\Providers\ImageResizeServiceProvider" --tag="config"

How To Use

Download Postman API

Download the Postman API Collection here.

Image Resize

Features

  • Resize
  • Crop
  • Change Quality

Service

JSCustom\ImageResize\Services\ImageResizeService

Sample Image Resize API

Controller

JSCustom\ImageResize\Http\Controllers\ImageResize\ImageResizeController

URL

{{url}}/api/image-resize

Form Data

{
  "image": `FILE`,
  "width": 150,
  "height": 150,
  "quality": 75,
  "option": "crop"
}

Method

POST

Headers

{
  "Content-Type": "multipart/form-data"
}

Response

{
    "status": true,
    "code": 201,
    "message": "Image has been created. Please see PUBLIC\\PATH\\OF\\RESIZED\\IMAGE\\2141667567259_DSC05028-Edit_FB.jpg",
    "payload": {
        "image": "PUBLIC\\PATH\\OF\\RESIZED\\IMAGE\\2141667567259_DSC05028-Edit_FB.jpg"
    }
}

How To Implement Image Resize Service

Add the service to your controller

use JSCustom\ImageResize\Services\ImageResizeService;

In your controller, follow this code structure

$image = ImageResizeService::imageResize($request);

Or initiate in the construct of your controller

public function __construct(
    \JSCustom\ImageResize\Services\ImageResizeService $ImageResizeService
) {
    $this->_imageResizeService = $ImageResizeService;
}

Then follow this code structure

$image = $this->_imageResizeService->imageResize($request);

Common Issues Encountered

GD error(s)

For PHP8.0 use (php8.1-gd and php8.2-gd are also available):

sudo apt-get install php8.0-gd

For PHP7.0 use (php7.1-gd, php7.2-gd, php7.3-gd and php7.4-gd are also available):

sudo apt-get install php7.0-gd

Support

For support, email developer.jeddsaliba@gmail.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固