Skip to content
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

Merged
merged 2 commits into from
Jan 27, 2017
Merged

[Filter] Upscale filter should use the highest dimension to calculate ratio #856

merged 2 commits into from
Jan 27, 2017

Conversation

jrattue
Copy link
Contributor

@jrattue jrattue commented Jan 24, 2017

Pull request for issue #855.

Reverts back to previous behaviour for upscale filter.

Closes: #855

Copy link
Collaborator

@alexwilson alexwilson left a 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){
Copy link
Collaborator

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
Copy link
Collaborator

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?

@alexwilson alexwilson added the State: Reviewing This item is being reviewed to determine if it should be accepted. label Jan 24, 2017
Copy link
Collaborator

@robfrawley robfrawley left a 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. 👍

@cedricziel
Copy link
Collaborator

Great, thank you for amending the changeset, @Rattler3 . @antoligy can you revisit and merge afterwards?

Copy link
Collaborator

@robfrawley robfrawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@robfrawley robfrawley added Level: Bug 🐞 This item involves a legitimate regression (bug) to existing functionality. State: Confirmed This item has been confirmed by maintainers as legitimate. and removed State: Reviewing This item is being reviewed to determine if it should be accepted. labels Jan 25, 2017
@robfrawley robfrawley added this to the 1.7.2 milestone Jan 25, 2017
@cedricziel cedricziel merged commit 409e151 into liip:1.0 Jan 27, 2017
@lsmith77 lsmith77 removed the State: Confirmed This item has been confirmed by maintainers as legitimate. label Jan 27, 2017
@cedricziel
Copy link
Collaborator

Thank you for your contribution, @Rattler3 ! 🎉

@jrattue
Copy link
Contributor Author

jrattue commented Jan 27, 2017

Cheers guys, thanks for the quick turnaround!

@jrattue jrattue deleted the upscale-fitler branch February 2, 2017 10:26
@robfrawley robfrawley changed the title Upscale filter should use the highest dimension [Filter] Upscale filter should use the highest dimension to calculate ratio Feb 7, 2017
@robfrawley robfrawley mentioned this pull request Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Level: Bug 🐞 This item involves a legitimate regression (bug) to existing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants