https://github.com/robopuff/tinypng
TinyPNG API implementation in PHP
https://github.com/robopuff/tinypng
php7 tinify tinypng-api
Last synced: about 2 months ago
JSON representation
TinyPNG API implementation in PHP
- Host: GitHub
- URL: https://github.com/robopuff/tinypng
- Owner: robopuff
- License: bsd-3-clause
- Created: 2018-11-01T13:30:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-16T09:29:55.000Z (almost 3 years ago)
- Last Synced: 2025-03-26T06:23:32.516Z (2 months ago)
- Topics: php7, tinify, tinypng-api
- Language: PHP
- Homepage: https://robopuff.github.io/tinypng/
- Size: 5.4 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/robopuff/tinypng)
# TinyPNG API client for PHP
PHP client for the TinyPNG API, Read more at [official TinyPNG documentation](https://tinypng.com/developers/reference).
* [Documentation](https://robopuff.github.io/tinypng/)
* [Issues](https://github.com/robopuff/tinypng/issues)To generate docs use [MKDocs](https://www.mkdocs.org/)
## Installation
```bash
composer require robopuff/tinypng
```## Usage
```php
$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
```bash
composer test-suite
```### Integration tests
```bash
TINYPNG_KEY=$YOUR_API_KEY composer test-integration
```## License
This software is licensed under the BSD-3-Clause License. [View the license](LICENSE).