I need to crop an image in the middle the original image on my application, to make the crop I need to provide the (x,y) coordinates, and that makes crop to start in the given coordinates.
So I understand in order to calculate x and y i need to apply the same calculation to both.
Please help me understand what I need to calculate the X coordinate to crop the image.
originalWidth = 1200
newWidth = 600
startCroopAt = ?
i.e. [x,y]
Image::crop(Yii::getAlias('@app/web/images/tmp/tmp_'.$name), $newWidth, $newHeight, [0,0])
->save(Yii::getAlias($path."/".$name), ['quality' => 80]);
Thanks for helping with this explanation.