secco2112 / tinify-php-sdk
PHP SDK to handle Tinify API requests.
1.1.1
2021-04-15 23:09 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: *
- ralouphie/mimey: *
Requires (Dev)
- phpunit/phpunit: *
- symfony/var-dumper: ^4.4
This package is auto-updated.
Last update: 2024-11-07 01:18:48 UTC
README
This is an unofficial PHP SDK for manipulating Tinify API data. Here is an example:
<?php use Secco2112\Tinify\Config; use Secco2112\Tinify\Options; use Secco2112\Tinify\Tinify; $config = new Config([ Options::TINIFYOPT_API_KEY => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ]); $tinify = new Tinify; $tinify->setConfig($config); $file_url = 'https://tinypng.com/images/example-orig.png'; $tinify->fromUrl($file_url)->download();
Installation
$ composer require secco2112/tinify-php-sdk
{ "require": { "secco2112/tinify-php-sdk": "*" } }
<?php require 'vendor/autoload.php'; use Secco2112\Tinify\Tinify; $tinify = new Tinify;
Docs
Click on one of the following sections to be redirected to the documentation:
- Getting started
- Shrink from file
- Shrink from URL
- Shrink from binary string
- Handle the data of shrank image
- Download image
- Save image on path
- Extract binary string of shrank image
- Resize methods
- Store in storage services