Closed fran-f closed 3 years ago
Option 2 seems like a good fix to me as well. And using the fit($width, $height)
method instead of resize()
should work fine.
fit() will crop the image to fit the given dimensions, while we only want to resize the image, keeping the same aspect ratio. With the constraints defined in the code, resize()
will do that.
Oops my bad. fit
does not work here indeed.
Can resize
actually be used in a single call? I don't see that option described in Intervention's documentation.
Or does it require to first compare which of height or width is the largest, then use widen
or heighten
accordingly?
Closing this — solved by #219 👍
While the text in the settings reads "You can choose a maximum width and height, in pixels.", as far as I can see the code only applies a width limit:
I'd be happy to provide a patch, and I can see three ways to solve this:
My preference would be to implement (2).