I have the below line of code which I am trying to use after an image is uploaded in order to resize the image.
I have confirmed my image does get uploaded correctly so the image file is in the correct location however I keep getting an error
The line of code I am trying to use is
$newwidth=60; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); imagecopyresampled($tmp,$atarget_path,0,0,0,0,$newwidth,$newheight, $width,$height);
I confirmed the $atarget_path holds the correct value in the form of ./img/avatars/testone.jpg and when I go to that folder on my server I see the testone.jpg file . So I am not sure why I am getting the below error messgage
Warning: imagecopyresampled() expects parameter 2 to be resource, string given in /home/****/public_html/****/avatarupload.php on line 84