1. Go to this page and download the library: Download devscast/tinify library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
devscast / tinify example snippets
use Devscast\Tinify\Client;
$tinify = new Client('yourtinifytoken');
use Devscast\Tinify\Client;
$tinify = new Client(
token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
proxy: 'http://user:[email protected]:8080'
);
use Devscast\Tinify\Client;
$tinify = new Client(token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$tinify->toFile(
source: $tinify->fromFile('/home/tinify/pictures/test.png'),
path: '/home/tinify/pictures/test-compressed.png'
);