PHP code example of tp5er / images

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

    

tp5er / images example snippets


$image = new \tp5er\Images\Image(\tp5er\Images\Image::IMAGE_GD,'./1.jpg'); // GD库
// 或者
$image = new \tp5er\Images\Image(\tp5er\Images\Image::IMAGE_IMAGICK,'./1.jpg');  // imagick库

//将图片裁剪为400x400并保存为corp.jpg
$image->crop(400, 400,100,30)->save('./crop.jpg');