Can not add text to image using imagecreatefromjpeg()

Alles, was PHP betrifft, kann hier besprochen werden.

Can not add text to image using imagecreatefromjpeg()

Postby Rafid » 06. March 2022 12:49

I wrote this code. but no image and error messages has been showing. I uncommented gd library from php.ini. Please help me to get rid of this.

screenshot link: https://drive.google.com/file/d/1DV8E31PqUxVGBe7ihbm0upld6JKst33q/view?usp=sharing

<?php
$font="namefont1.ttf";
$image=imagecreatefromjpeg("image.jpeg");
$color=imagecolorallocate($image, 19, 21, 22); //image, r, g, b
$name= "Tahmeed Mahbub";
imagettftext($image, 10, 0, 200, 200, $color, $font, $name);
//image, fontsize, angel, x axis, y axis, color, font, name
header('Content-Type:image/jpeg');
imagejpeg($image);
imagedestroy($image);
?>
Rafid
 
Posts: 1
Joined: 06. March 2022 12:40
XAMPP version: 3.3.0
Operating System: Windows 10

Return to PHP

Who is online

Users browsing this forum: No registered users and 48 guests