承接 ingowalther/image-minify-php-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ingowalther/image-minify-php-client

最新稳定版本:0.0.4

Composer 安装命令:

composer require ingowalther/image-minify-php-client

包简介

PHP Implementation of Image Minify API

README 文档

README

Basic PHP-Implementation of Image Minify API

see https://github.com/ingowalther/image-minify-api

Installation

composer require ingowalther/image-minify-php-client

Usage

$client = new \IngoWalther\ImageMinifyPhpClient\Client\ImageMinifyApiClient($serverUrl, $apiKey);
Parameter Description
$serverUrl The url of your Image Minify API Installation (e.g. http://example.com)
$apiKey Your API-Key

Get compressed image

Returns a "CompressedImage" Object

/** @var \IngoWalther\ImageMinifyPhpClient\Response\CompressedImage $compressedImage */
$compressedImage  = $client->getCompressedImage($imagePath);

// The size before compression
$oldSize = $compressedImage->oldSize;

// The size after compression
$newSize = $compressedImage->newSize;

// The saving in percent
$saving = $compressedImage->saving;

// The binary-content of the compressed image
$binaryContent = $compressedImage->binaryContent;

Write compressed image

Compresses the given image and writes the result to the targetpath

$success = $client->writeCompressedImage($imagePath, $newImagePath);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-05