I have a system where users can have membership card. I already did the text on an image but what I want is to put their picture on the membership card using GD library. I cant seem to find a solution for this or i am just bad at googling. I will appreciate any help. Here is my code so far:
header("Content-type: image/jpeg");
$imgPath = base_url().'/assets/images/membershipcard.jpg';
$image = imagecreatefromjpeg($imgPath);
$color = imagecolorallocate($image, 255, 255, 255);
$font_path = './assets/fonts/Roboto.ttf';
$string = $cust_fn." ".$cust_ln;
$fontsize = 40;
$x = 30;
$y = 530;
imagettftext ($image , $fontsize , 0 , $x , $y , $color , $font_path, $string );
imagejpeg($image);