PHP code example of nhujanen / image

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

    

nhujanen / image example snippets


// Load test.png
$image = Wex\Image::load('test.png');

// Resize to 300x200 (contained)
$thumb = $image->resize(300, 200);

// Save image as JPEG
$thumb->saveAs(Wex\Image\JPEG::class, "test_thumb.jpg");