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
Thumbnailing with php code?
Re: Thumbnailing with php code?
Try this: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
Code: Select all
<?php
$im = new Imagick("Large.jpg");
$im->thumbnailImage(190, 125, true);
$im->writeImage("tn_small.jpg");
?>
Mikko Koppanen
My blog: http://valokuva.org
My blog: http://valokuva.org
Re: Thumbnailing with php code?
this is great thanks, is the a listing of all the functions somewhere? Because, i'd like to add -strip and -unsharpmkoppanen wrote:Try this: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
Code: Select all
<?php $im = new Imagick("Large.jpg"); $im->thumbnailImage(190, 125, true); $im->writeImage("tn_small.jpg"); ?>