Free Trial
10 days, no credit_card

<< More Tutorials

How to resize an image by width and height in PHP using rethumb?

To resize an image or photo in PHP use the following code:

    $param1_operation = "height";
    $param1_value = 100; // New height in pixels.

    $param2_operation = "width";
    $param2_value = 100; // New width in pixels.
    $image_url = "";
    $image_filename = "resized-image.jpg";

    file_put_contents($image_filename, file_get_contents("$param1_operation/$param1_value/$param2_operation/$param2_value/$image_url"));

Start using this example now

Use the following commands to get started:

$ git clone
$ cd rethumb-php-examples
$ php resize-by-width-and-height.php

More examples using PHP