-
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
[Filter] Upscale filter should use the highest dimension to calculate ratio #856
Conversation
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.
Thanks for the contribution! I think that this can be smoothed over a bit, but in principle I am fine with this change.
@@ -70,7 +70,11 @@ public function load(ImageInterface $image, array $options = array()) | |||
if (null == $width || null == $height) { | |||
$ratio = max($widthRatio, $heightRatio); | |||
} else { | |||
$ratio = min($widthRatio, $heightRatio); | |||
if('min' === $this->dimensionKey){ |
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.
Perhaps $ratio = ('min' === $this->dimensionKey) ? max($widthRatio, $heightRatio) : min($widthRatio, $heightRatio)
?
/** | ||
* Test cases for UpScaleFilterLoader class. | ||
* | ||
* @covers Liip\ImagineBundle\Imagine\Filter\Loader\UpScaleFilterLoader |
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.
Casing on the class-name is a bit dodgy!
Also can the new test incorporated into ScaleLoader so that all the tests for this class are in one place?
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.
Outside of the changes @antoligy already requested, this looks find. 👍
Great, thank you for amending the changeset, @Rattler3 . @antoligy can you revisit and merge afterwards? |
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.
👍
Thank you for your contribution, @Rattler3 ! 🎉 |
Cheers guys, thanks for the quick turnaround! |
Pull request for issue #855.
Reverts back to previous behaviour for upscale filter.
Closes: #855