Reputation: 35
First, I apologize for my English .
I have a vertical or horizontal rectangular image. (As shown) .
I want to become a square. Without cutting. (As shown) .
It is better used Intervention Image Library .
thanks for your help .
Upvotes: 1
Views: 192
Reputation: 469
I would say this is non exclusive php question...
h = height
and w = weight
.h > w
make new pic with square of h place the pic in (h-w) / 2
top
position and zero on right.w > h
make new pic with square of w place the pic in (w-h) / 2
right
position and zero on top.Upvotes: 1