Page 1 of 1

Thumbnailing with php code?

Posted: 2008-08-24T10:23:41-07:00
by acctman
I what to thumbnail images to a max width 190px and max height of 125px keeping within aspect ratio
ex: Large.jpg thumbnailed to 190 x 125 tn_small.jpg

does anyone know how to do this in php, fast clean with min. cpu usage

Re: Thumbnailing with php code?

Posted: 2008-08-24T13:33:40-07:00
by mkoppanen
acctman wrote:I what to thumbnail images to a max width 190px and max height of 125px keeping within aspect ratio
ex: Large.jpg thumbnailed to 190 x 125 tn_small.jpg

does anyone know how to do this in php, fast clean with min. cpu usage
Try this:

Code: Select all

<?php
$im = new Imagick("Large.jpg");
$im->thumbnailImage(190, 125, true);
$im->writeImage("tn_small.jpg");
?>

Re: Thumbnailing with php code?

Posted: 2008-08-24T22:48:35-07:00
by acctman
mkoppanen wrote:
acctman wrote:I what to thumbnail images to a max width 190px and max height of 125px keeping within aspect ratio
ex: Large.jpg thumbnailed to 190 x 125 tn_small.jpg

does anyone know how to do this in php, fast clean with min. cpu usage
Try this:

Code: Select all

<?php
$im = new Imagick("Large.jpg");
$im->thumbnailImage(190, 125, true);
$im->writeImage("tn_small.jpg");
?>
this is great thanks, is the a listing of all the functions somewhere? Because, i'd like to add -strip and -unsharp

Re: Thumbnailing with php code?

Posted: 2008-08-28T14:26:41-07:00
by mkoppanen