Page 1 of 1

resizing images in PHP with Imagick

Posted: Mon Dec 21, 2009 6:05 am
by Stevyn
source: http://www.fliquidstudios.com/2009/05/0 ... nt-page-1/

Code: Select all

<?php
function resize_image($file, $w, $h, $crop=FALSE) {
    $img = new Imagick($file);
    if ($crop) {
        $img->cropThumbnailImage($w, $h);
    } else {
        $img->thumbnailImage($w, $h, TRUE);
    }

    return $img;
}
resize_image(‘/path/to/some/image.jpg’, 150, 150);