Any way to tell Image::thumbnail
to not upscale if dimensions are smaller than what's supplied?
#3531
Unanswered
binaryfire
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I need to set a max limit for image width and height in my Laravel app. Any image that's above these dimensions should be resized down to the limit, and images that are already below the limit shouldn't be upscaled. Is there a way to achieve this with
Image::thumbnail
? I'd prefer to use that overImage::newFromFile
for performance reasons.I've tried
$image = Image::thumbnail($file, $maxWidth, ['height' => $maxHeight]);
but images smaller than the provided dimensions are being upscaled.Beta Was this translation helpful? Give feedback.
All reactions