resizing images in PHP with Imagick

Let us talk about scripts, HTML, Perl, PHP, apache, etc.
User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:
resizing images in PHP with Imagick

Post by Stevyn » Mon Dec 21, 2009 6:05 am

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);




Post Reply