Free Trial
10 days, no credit_card

<< More Tutorials

How to create a square thumbnail from an image in PHP using rethumb?

To create a square thumbnail in PHP use the following code:

    $param_operation = "square";
    $param_value = 100; // Square size in pixels.
    $image_url = "";
    $image_filename = "resized-image.jpg";

    file_put_contents($image_filename, file_get_contents("$param_operation/$param_value/$image_url"));

Start using this example now

Use the following commands to get started:

$ git clone
$ cd rethumb-php-examples
$ php resize-to-square.php

More examples using PHP