-
Notifications
You must be signed in to change notification settings - Fork 379
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
Fix #769 #770
Fix #769 #770
Conversation
$ratio = max($widthRatio, $heightRatio); | ||
} else { | ||
$ratio = min($widthRatio, $heightRatio); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be $ratio = ($width === null || $height === null) ? max($widthRatio, $heightRatio) : min($widthRatio, $heightRatio);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, either way that is just a style thing, I don't think it will be a performance issue, so I'm okay with anything. you might see this info http://stackoverflow.com/a/11643364
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in Symfony we generally use null === $foo
If image smaller in dimensions than the max arguments, Downscale doesn't upscale, and if image greater in dimensions than min arguments Upscale doesn't downscale.
|
||
if ($ratio > 1) { | ||
return $image; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be controversial thing, discuss on this 🎱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, now that's my kinda fix! 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be an option, defaulting to off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking more like, creating another filter "scale" which will do either, the filters should do only what they should, I don't know maybe it's just clear that way, moreover downscale and upscale should be derived from scale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine for me too
Then I'll close this and work on the filter, with another feature for these filters |
This permanently and efficiently fixes the problem