Skip to content

robopuff/tinypng

Repository files navigation

Build Status

TinyPNG API client for PHP

PHP client for the TinyPNG API, Read more at official TinyPNG documentation.

To generate docs use MKDocs

Installation

composer require robopuff/tinypng

Usage

$tinyPng = new \TinyPng\TinyPng(new \TinyPng\Client\GuzzleClient('your_api_key'));
$tinyPng
    ->optimize(new \TinyPng\Input\Filesystem('unoptimized_image.png'))
    ->store(new \TinyPng\Output\Storage\Filesystem('optimized_image.png'));

Running tests

composer test-suite

Integration tests

TINYPNG_KEY=$YOUR_API_KEY composer test-integration

License

This software is licensed under the BSD-3-Clause License. View the license.