11-20-2009, 01:26 PM
|
#11 (permalink)
|
|
The Acquainted
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
|
Quote:
Originally Posted by mm88
Hi, Compliments! Great Code!
Only a question:
your script creates a 250 x 250 cropped thumb.
In which way can I modify the script to create a thumb with different width and height?
For example, to create a 400 (w) x 200 (h) cropped thumb ?
thanks!
|
At a quick glance, change the following..
Code:
function createThumb(){
$thumbSize = 250; // will create a 250 x 250 thumb
$this->thumb = imagecreatetruecolor($thumbSize, $thumbSize);
imagecopyresampled($this->thumb, $this->myImage, 0, 0,$this->x, $this->y, $thumbSize, $thumbSize, $this->cropWidth, $this->cropHeight);
}
to
Code:
function createThumb(){
$thumbSize1 = 400;
$thumbSize2 = 200;
$this->thumb = imagecreatetruecolor($thumbSize1, $thumbSize2);
imagecopyresampled($this->thumb, $this->myImage, 0, 0,$this->x, $this->y, $thumbSize, $thumbSize, $this->cropWidth, $this->cropHeight);
}
__________________
Thanks... Simon
Sex, Drugs & Linux Rules
|
|
|