Hi, I am trying to resize an image. I run the following code and get no errors, but the image does not crop. I have GD installed.
$thumbnail = "./includes/gallery/images/thumbs/$thumbtocopy";$newthumbnail = imagecreatetruecolor(70, 70);$thumbtosize = imagecreatefromjpeg($thumbnail);$thumbsize = getimagesize($thumbnail);$newwidth = $thumbsize[0] / 2;$newheight = $thumbsize[1] / 2;$cropLeft = ($newwidth/2) - ($width/2);$cropHeight = ($newheight/2) - ($height/2);imagecopyresampled($newthumbnail, $thumbtosize, 0, 0, $cropLeft, $cropRight, 70, 70, $newwidth, $newheight);imagedestroy($newthumbnail);imagedestroy($thumbtosize);
The directory is also set to 777. Whats wrong? Thank you.