I want to create certificates for users on my website but following code isn't working and only showing grey square when loaded on localhost...
<?php
header('content-type:image/jpeg');
$font="BRUSHSCI.TTF";
$image=imagecreatefromjpeg("certificate.jpg");
$color=imagecolorallocate($image,19,21,22);
$name="Name";
imagettftext($image,50,0,365,420,$color,$font,$name);
$date="12th may 2021";
imagettftext($image,20,0,450,595,$color,"AGENCYR.TTF",$date);
imagejpeg($image);
imagedestroy($image);
?>