PHP code example of happyproff / kartinki

1. Go to this page and download the library: Download happyproff/kartinki 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/ */

    

happyproff / kartinki example snippets

 php

use happyproff\Kartinki\Kartinki;

$thumbnails = (new Kartinki)->createImageVersions(
    '/path/to/image/filename.jpg',
    [
        'square' => '200x200',
        'normal' => '400x400:fit',
        'big'    => '1280x720:fit,quality=100',
    ],
    '/output/dir' // optional
);
 php

[
    'square' => '1ceebb2cf4b0425a0ea1e1cb49810a07_square.jpg',
    'normal' => '1ceebb2cf4b0425a0ea1e1cb49810a07_normal.jpg',
    'big'    => '1ceebb2cf4b0425a0ea1e1cb49810a07_big.jpg'
]