ingowalther/image-minify-api 问题修复 & 功能扩展

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

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

ingowalther/image-minify-api

Composer 安装命令:

composer require ingowalther/image-minify-api

包简介

README 文档

README

Install an Image-Compression-Service (like TinyPng, JPEGMini) on your own Server!

Build Status

Currently supports:

Installation

Create Database

You should create a database first. In this database Image Minify API will create all necessary tables during composer install.

Install Project

composer create-project ingowalther/image-minify-api %installation-folder-name%

Set permissions for files

chmod a+rw log

Setup Webserver

vHost DocRoot -> web/

Usage

Create API-Key

 bin/console user:add

Enter a Username. If the user is created correctly you will see the API-Key in your Terminal.

Compress an Image

POST with Params "api_key" and File with Name "image" to http://yourserver/minify

Example:

curl --form "image=@test.jpg" --form api_key=VVDFNNflLIQdCH5vnx0RkmCxxjhHIL6  http://localhost/minify > result.json

Response

You will get a Json-Response like this:

{
   "success":true,
   "oldSize":539,
   "newSize":394,
   "saving": 26,
   "image":"\/9j\/4AAQSkZJRgABAQAAAQABAAD\/\/gATQ3JlYXRlZCB3aXRoIEdJTVD\/2wCEAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u\/sBCgoKCgoKCwwMCw8QDhAPFhQTExQWIhgaGBoYIjMgJSAgJSAzLTcsKSw3LVFAODhAUV5PSk9ecWVlcY+Ij7u7+\/\/CABEIAAEAAQMBIgACEQEDEQH\/xAAUAAEAAAAAAAAAAAAAAAAAAAAH\/9oACAEBAAAAAGb\/xAAUAQEAAAAAAAAAAAAAAAAAAAAA\/9oACAECEAAAAH\/\/xAAUAQEAAAAAAAAAAAAAAAAAAAAA\/9oACAEDEAAAAH\/\/xAAUEAEAAAAAAAAAAAAAAAAAAAAA\/9oACAEBAAE\/AH\/\/xAAUEQEAAAAAAAAAAAAAAAAAAAAA\/9oACAECAQE\/AH\/\/xAAUEQEAAAAAAAAAAAAAAAAAAAAA\/9oACAEDAQE\/AH\/\/2Q=="
}
Parameter Description
success true or false
oldSize ImageSize before compressing (in Byte)
newSize ImageSize after compressing (in Byte)
saving The saving of bytes in percent
image The binarydata of the compressed image (base64 encoded)

List all user

 bin/console user:list

Output:

Console output

API-Clients

PHP: https://github.com/ingowalther/image-minify-php-client

Grunt-Task: https://github.com/yannicstadler/image-minify-api-grunt-task

TODO

  • Quota

统计信息

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

GitHub 信息

  • Stars: 26
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固