PHP ImageCopy function Always right

Default for the ImageCopy function Logo location, left-top.

imagecopy (resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h)

How can I do for images of any sizes, always imposed right-bottom?


Answer 1, Authority 100%

You need to know the dimensions of both images. Accordingly

list($iw1, $ih1) = getimagesize($logo_path);
list($iw2, $ih2) = getimagesize($path);
imagecopy($desct, $source, $iw2 - $iw1, $ih2 - $ih1, 0, 0, $iw1, $ih1);
//    3,4  5,6 

Answer 2

Well, what’s the problem of learning the dimensions of the final image and retreat the required number of pixels from above and left?