Originariamente inviato da DjBart
la funzione $img2->resize non è dichiarata in questo file
Scusami, hai ragione! E' nell'include!
Codice PHP:
public function resize($width, $height, $cutImage = false) {
$this->resizeNormal($width, $height);
}
private function resizeNormal($w, $h) {
// set data
$size = $this->info;
$im = $this->gdID;
$newwidth = $size[0];
$newheight = $size[1];
if( $newwidth > $w ){
$newheight = ($w / $newwidth) * $newheight;
$newwidth = $w;
}
if( $newheight > $h ){
$newwidth = ($h / $newheight) * $newwidth;
$newheight = $h;
}
$new = imagecreatetruecolor($newwidth, $newheight);
$result = imagecopyresampled($new, $im, 0, 0, 0, 0, $newwidth, $newheight, $size[0], $size[1]);
@imagedestroy($im);
$this->gdID = $new;
$this->updateInfo();
return $result;
}