-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to resize images only when they exceed max-Size #1184
Comments
It would always keep the ratio, so you can just set the width and the height will be calculated depending on centerCrop value. |
Thanks for this hint I will try it. And many add a Wiki page |
I also have similar scenario, I want to scale down an image, if its larger than specific height or width. Once, we have resize it, we will upload it to server. How Upload.resize() works? var resizedImage = Upload.resize(imagefile,100,100, 0.8,'image/jpg','1:2',true); Upload.http({ |
I updated the readme and added docs for |
@danialfarid If I am not wrong, fixing this issue has only few lines of code :D In resize.js I changed lines 41 - 46: if (!width) {
width = imageElement.width;
} else {
if (width > imageElement.width) {
width = imageElement.width;
}
}
if (!height) {
height = imageElement.height;
} else {
if (height > imageElement.height) {
height = imageElement.height;
}
} It works for me. What do you think? |
Fixed at 11.0.0. |
Hey,
maybe this question is too simple, but I don't get it.
Is it possible to resize images only when the exceed max-Size or max-height.
And how to resize them to a given width by keep the ratio ?
thanks
Dominic
The text was updated successfully, but these errors were encountered: