Questo e' il secondo esempio della funzione imagecopyresampled
A me a copiarlo uguale da errore
<?php
// The file
$filename = 'test.jpg';
// Set a maximum height and width
$width = 200;
$height = 200;
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($filename);
///////////////////////////////////// qui mi da errore ///////////////////////////////////
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
/////////////////////////////////////////////////////////////////////////////////////////////
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
?>
L'errore che mi da e' :
Parser error "';' expected after expression (Found token: Variable($width))"
dove scrivo $width = ($height / $height_orig) * $width_orig;
E stessa cosa per $height
Idee????