I'm creating dynamic image in PHP with this:
$image = imagecreatetruecolor(708, 500);
Then I add some customization, background color, watermark text...
imagefilledrectangle($image, 0, 0, 708, 500, $whiteColor);
imagettftext($image, $fontsize - 3, 0, 400, 500 - $fontsize + 3, $infoColor, $fontfile, $info);
And finaly save the file:
imagepng($image, "test.png");
Everything works well, I get that test.png
with white background, watermark, everything.
But this PHP file also receive POST
values from JSON, one of them is base64 image. I know I can use something like that:
$stringImage = imagecreatefromstring(base64_decode($data->image));
But I don't know how to embed that posted image to my dynamicaly created image. Is that even possible?
Note: yes, base64 image is valid image
Aucun commentaire:
Enregistrer un commentaire