Gregwar / Image

A PHP library to handle images
MIT License
1k stars 191 forks source link

Centre Merged Images? #184

Open AndrewMarkUK opened 2 years ago

AndrewMarkUK commented 2 years ago

I am Implementing code as such:

Image::open($target_path . '/' . $imageName)->merge(Image::open($source_path)->scaleResize('',$h_o))->save($target_path . '/' . $imageName, 'jpg');

In this scenario I am taking a 16:9 image (already Created) $target_path, taking a 1:1 image $source_path and merging them. The images merge, but, I would like to center the 1:1 to the 16:9 image. Currently when I run this code, the 1:1 image is attached to the left of the image. Is there a way of centering the image instead?