I want to resize crop image like below :
if image is lower than 500x400, scale up and crop, also if image is higher, scale down and crop.
i used some resize, canvas, fit
and other functions but getting some confused at all.
I see users try to reach this post to find answer and i write here the comment:
thanks @snapey , it's my bad in coding, and ->fit()
is doing that without any check, i used fit after some changes to image and so final result is get unexpected, but without any modify, fit works fine like expected.
@Snapey answer is correct, I'm using the same code, but my problem is that I modified the image before reaching this code and because of that, I'm getting unexpected results.