onliner/imgproxy-php 问题修复 & 功能扩展

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

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

onliner/imgproxy-php

最新稳定版本:v0.2.4

Composer 安装命令:

composer require onliner/imgproxy-php

包简介

ImgProxy url builder for PHP

README 文档

README

ImgProxy PHP

This is a PHP library that makes it easy to build URL for ImgProxy.

Version Total Downloads Php License Build Status

Installation

The preferred way to install this extension is through composer.

Either run

composer require onliner/imgproxy-php:^0.2

or add this code line to the require section of your composer.json file:

"onliner/imgproxy-php": "^0.2"

Usage

$key = getenv('IMGPROXY_KEY');
$salt = getenv('IMGPROXY_SALT');

$src = 'http://example.com/image.jpg';

$builder = UrlBuilder::signed($key, $salt);
$builder = $builder->with(
    new Dpr(2),
    new Quality(90),
    new Width(300),
    new Height(400)
);
    
$url = $builder->url($src);  // encoded url
$url = $builder->encoded(false)->url($src); // plain url
$url = $builder->url($src, 'png'); // change image format

# example: /9SaGqJILqstFsWthdP/dpr:2/q:90/w:300/h:400/aHR0cDovL2V4YW1w/bGUuY29tL2ltYWdl/LmpwZw

License

Released under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 22
  • Watchers: 9
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-14