robopuff/tinypng

Modern TinyPNG client for PHP

v1.0.1 2022-04-05 09:52 UTC

This package is auto-updated.

Last update: 2024-04-16 12:56:01 UTC


README

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.