I'm using imagettftext
to draw text on an image using PHP GD
header('Content-Type: image/png');
$im = imagecreatetruecolor(400, 30);
$white = imagecolorallocate($im, 255, 255, 255);
$text = 'Test';
$font = 'data/font/arial.ttf';
imagettftext($im, 20, 0, 10, 20, $white, $font, $text);
imagepng($im);
imagedestroy($im);
It's working fine but the problem is that the font file handle is not closed after imagedestroy($im);
(inspected with procexp)
And as i expected, I got a Permission denied
warning when I tried to unlink
the font file.
How to release the used font file? Thank you
I'm testing on windows xampp