I have a simple script that adds an image inside an image. Here is the code:
<?php
$im = imagecreatetruecolor(650, 400);
$stamp = imagecreatefrompng('test.png');
$red = imagecolorallocate($im, 209, 231, 244);
imagefill($im, 0, 0, $red);
$marge_right = 10;
$marge_bottom = 133;
$sx = imagesx($stamp);
$sy = imagesy($stamp);
imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im)
- $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
Now this will place the test image 10x from the right of the big image and 133px from bottom of image. How to place the image centered vertically depending on its height??
Thanks