定制 lincanbin/php-image-resize-class 二次开发

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

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

lincanbin/php-image-resize-class

Composer 安装命令:

composer require lincanbin/php-image-resize-class

包简介

Automatic extract the square central part of the uploaded image, and zoom to the specified size.

README 文档

README

Automatic extract the square central part of the uploaded image, and zoom to the specified size.

Parameters

$UploadAvatar = new ImageResize('FormName');
$Result = $UploadAvatar->Resize(256, 'upload/avatar/large.png', 80);
/*
256: the size of the picture to be compressed
upload/avatar/large.png: save path
80: Picture quality, 100 indicates no compression. 
*/

Example

Resize image from post field:

$UploadAvatar = new ImageResize('PostField', 'Avatar');
$Result = $UploadAvatar->Resize(256, 'upload/avatar/large.png', 80);

Resize image from Web:

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_URL, 'https://avatars0.githubusercontent.com/u/5785188?v=3&s=460');
$response =  curl_exec($ch);
curl_close($ch);

$UploadAvatar = new ImageResize('String', $response);
$Result = $UploadAvatar->Resize(256, 'upload/avatar/large.png', 80);

License

Copyright 2006-2015 Canbin Lin (lincanbin@hotmail.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache
  • 更新时间: 2015-05-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固