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();
$ composer require secco2112/tinify-php-sdk
{
"require": {
"secco2112/tinify-php-sdk": "*"
}
}
<?php
require 'vendor/autoload.php';
use Secco2112\Tinify\Tinify;
$tinify = new Tinify;
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