Not what I expected (It's supposed to be the same ratio - just cropped on the bottom to make it thinner; it looks stretched using
abs()
). EDIT I changed line 9 to $width = abs(ceil($width-(abs($r-$w/$h))));
and added in a line after that, $height = $height - abs($h);
, I think it fixed it mostly.