PHP code example of thayllonvictor / phpthumb

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

    

thayllonvictor / phpthumb example snippets



// Create class PHPThumb
$phpThumb = new PHPThumb();

// Set file imagem: upload file or path file
$phpThumb->loadImage('example.jpg');

// Set width your thumbnail
$phpThumb->thumbWidth('100');

// Set height yout thumbnail
$phpThumb->thumbHeight('100');

// Set name image with a extension 
$phpThumb->setFileName('new-thumnail.png');

// Set dir save
$phpThumb->savePath('thumbs/');

// Generate thumbnail
$phpThumb->generateThumb();