after receiving the image from the client , I would like to resize it and then store it . I am using this function:
function PIPHP_ImageResize($image, $w, $h)
{
$oldw = imagesx($image);
$oldh = imagesy($image);
$temp = imagecreatetruecolor($w, $h);
imagecopyresampled($temp, $image, 0, 0, 0, 0,
$w, $h, $oldw, $oldh);
return $temp;
}
$image = PIPHP_ImageResize($_FILES['file']['tmp_name'],10,10);
move_uploaded_file($image, $newname);
unfortunately I got these warning:
- Warning: imagesx() expects parameter 1 to be resource, string given...
- Warning: imagesy() expects parameter 1 to be resource, string given ...
- Warning: imagecopyresampled() expects parameter 2 to be resource, string given ...
- Warning: move_uploaded_file() expects parameter 1 to be string, resource given ...
How could I fix the problem !!