PHP First Steps


Example

Installation

Using apt on Debian based systems

sudo apt-get install php5-imagick

Using Homebrew on OSX/macOs

brew install imagemagick

To see the dependencies installed using the brew method, visit brewformulas.org/Imagemagick.

Using binary releases

Instructions on imagemagick website.

Usage

<?php

$imagen = new Imagick('imagen.jpg');
$imagen->thumbnailImage(100, 0); 
//if you put 0 in the parameter aspect ratio is maintained

echo $imagen;

?>