In short, the user uploads an image and that image gets converted to base64. However, if a user upload an iamge with a 2000 width and 3000 height, i don't want to convert this large size into base64. Hence, I want to crop the width of the image upload (with height also reduced proporitonally to the reduction of width) before it get converted into text format.
Below is how its converted before the crop
$sessionThumbnail= addslashes($_FILES['sessionThumbnail']['tmp_name']);
$sessionThumbnail_name = addslashes($_FILES['sessionThumbnail']['name']);
$sessionThumbnail = file_get_contents($sessionThumbnail);
$sessionThumbnail = base64_encode($sessionThumbnail);
How would i add the cropping in between?