PHP code example of codewithkyle / jitter-core

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

    

codewithkyle / jitter-core example snippets


use codewithkyle\JitterCore\Jitter;

class ImageController
{
    public function transformImage()
    {
        $imageFilePath = "./image.jpg"; // copy of source image (will be overwritten)
        $params = ["w" => 320, "ar" => "1:1", "fm" => "jpg"]; // See transformation parameter table below for more options

        $transformSettings = Jitter::BuildTransform($params); // Transform settings can be hashed with the base image's indentifier when caching
        Jitter::TransformImage($imageFilePath, $transformSettings); // Manipulates and overwrites the image located at $imageFilePath

        // Optional Next Steps:
        // Save $imageFilePath a cloud provider (such as S3)
    }
}