kinglozzer/silverstripe-tinypng 问题修复 & 功能扩展

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

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

kinglozzer/silverstripe-tinypng

最新稳定版本:3.0.2

Composer 安装命令:

composer require kinglozzer/silverstripe-tinypng

包简介

README 文档

README

An extension to SilverStripe's Image class to integrate with the TinyPNG API.

Installation

With composer:

composer require kinglozzer/silverstripe-tinypng ^3.0

Usage

Add your TinyPNG API key to your _config.yml:

Kinglozzer\SilverStripeTinyPng\ImageExtension:
  tinypng_api_key: 'xxxx_yyyy_zzzz'

Add the Compressed method to your templates when outputting images:

{$Image.CroppedImage(150, 300).Compressed}

NOTE: Compressed must be the last modification you call on your image - otherwise you’ll compress an image, then resample it again afterwards, potentially undo-ing the compression.

If you set an invalid API key, or exceed your monthly API allowance, then a warning will be shown in dev/test mode. In live mode compression will (intentionally) silently fail and output the un-compressed image, but will still log a message via the Logging API.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-01-13