I’m using the PHP copy function to copy an image after upload to a directory. Is there a way to resize the image before I copy it? I need to resize it to 80×80 for use in my forum.
Here is how I’m calling my copy:
//lets move a copy to the img dir for the forum
$avatar_tmp_file = 'forum/img/avatars/'.$_SESSION['forum_uid']. '.jpg';
copy($_FILES['file']['tmp_name'], $avatar_tmp_file);
Any suggestions?
Yes there is a way to do so. using imagick for instance.