robopuff / tinypng
Modern TinyPNG client for PHP
v1.0.1
2022-04-05 09:52 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- psr/cache: ^3.0
- psr/http-message: ^1.0
- psr/log: ^1.1
Requires (Dev)
- paragonie/certainty: ^2.8
- phan/phan: ^4.0
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^0.12
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2025-03-16 14:51:42 UTC
README
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.