hello all.. I am trying to make a function to resize images but i'm getting an error.
Error:
Warning: imagecopyresized(): Invalid image dimensions
here's the code:
function imageResize($image) {
$dimensions = getimagesize($image);
$width = $dimension[0];
$height = $dimension[1];
$newWidth = 200;
$newHeight = 150;
$canvas = imagecreatetruecolor($newWidth,$newHeight);
$piece = imagecreatefromjpeg($image);
imagecopyresized($canvas, $piece, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
imagejpeg($canvas, $image, 90);
}
I don't understand what the problem is really :queasy:
Hope someone can help me out.