I am trying to resize an image which is taken from a cropping tool used on my form. The code below is being used with the library Croppie.
if($_POST['imagebase64'] != '') {
$data = $_POST['imagebase64'];
list($type, $data) = explode(';', $data);
list(, $data) = explode(',', $data);
$data = base64_decode($data);
file_put_contents(APPPATH.'../assets/image64.png', $data);
}
I would like to know how to resize the image before pushing it to the server. Preferably, I would like to use stock php, something like imagecopyresampled
but I'm not sure how to go about it.
Any help would be much appreciated.