From text as attached photo in とまったく同じように、画像に寸法テキストを書き込む方法はありますPHP
か?
私が前に試したこと:
$sourceImage = "photo.jpg";
$destinationImage = "new-photo.jpg";
$image = imagecreatefromjpeg($sourceImage);
$color = imagecolorallocate($image, 50, 50, 50);
$text = "A sample text";
$font = "font.ttf";
$fontSize = 18;
$rotation = 25;
$x = 370;
$y = 400;
$quality = 90;
imagettftext($image, $fontSize, $rotation, $x, $y, $color, $font, $text);
imagejpeg($image, $destinationImage, $quality);
どんなアイデアや助けも大歓迎です。