定制 picsmize/picsmize-php 二次开发

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

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

picsmize/picsmize-php

最新稳定版本:v1.0

Composer 安装命令:

composer require picsmize/picsmize-php

包简介

Picsmize - Image Optimizer

README 文档

README

Quick Installation

To install the Picsmize library, Here is how you can install using command line,

$ composer require picsmize/picsmize-php

Configuration

Load the Picsmize library into your page

require_once 'Picsmize/Picsmize.php';

If you don't have your API Key just yet, you can Sign Up for a free account. And That's it! Start optimizing..!

Quick Example

This Picsmize PHP library allows all the operations available with the Picsmize API. The following example uses image fetch, compress, resize and filter with different mode and get the output file directly with toJSON() method:

/**
* Initialize `Picsmize` Class
*/

$picsmize = new Picsmize('your-api-key');

/**
* Use of fetch() method
*/

$picsmize->fetch('https://www.website.com/image.jpg')

/**
* Use of compress() method with medium mode
*/

->compress(Picsmize::COMPRESS_LOW)

/**
* Use of resize() method with auto mode
* and width set to 400
*/

->resize(Picsmize::RESIZE_AUTO, array(
'width' => 400
))

/**
* Use of filter() blur method with gaussian mode
* and value set to 10
*/

->filter(Picsmize::FILTER_BLUR, array(
'mode' => 'gaussian',
'value' => 10
))

/**
* Call toJSON() on the final step and return the JSON response
*/

->toJSON(function ($response) {
/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == false) {
throw new Exception($response['message']);
}

print_r($response);
});

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2022-07-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固