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

Downscale filter scales an image to fit bounding box #696

Merged
merged 4 commits into from
Jul 14, 2016

Conversation

aminin
Copy link
Contributor

@aminin aminin commented Jan 18, 2016

liip_imagine:
    filter_sets:
        my_downscale:
            filters:
                downscale: { max: [400,400] }  # Transforms 800x1600 to 200x400 rather than 400x800

@lsmith77 lsmith77 added the State: Reviewing This item is being reviewed to determine if it should be accepted. label Jan 18, 2016
@lsmith77
Copy link
Contributor

that seems like a BC break .. I fear we would need to introduce a new config option for this new behavior

@aminin
Copy link
Contributor Author

aminin commented Jul 12, 2016

@lsmith77

In this PR I propose the downscale filter to work as downscale to fit bounding box
The actual behaviour is downscale to get out of the bounding box and sometimes upscale instead of downscale

It is hard to assume that the second one is the supposed behaviour cause it's oviously incorrect.

I see no BC break here.

@lsmith77
Copy link
Contributor

yeah classic bug fix vs. BC break ..

the current filter has existed since Jan 2015 introduced in #610 by @sascha-meissner

BTW the PR contained a test case which however didn't expose this bug:
https://github.com/liip/LiipImagineBundle/blob/master/Tests/Imagine/Filter/Loader/FloatToIntCastByRoundDownscaleFilterLoaderTest.php

@aminin
Copy link
Contributor Author

aminin commented Jul 14, 2016

Hi, @lsmith77 .

Thank you for the explanation of historical background.

So, we have 2 choices:

  1. If you insist, I'd
  # introduce a new config option mode: { choice: inset|incorrect; default: incorrect }
  downscale: { max: [400, 400], mode: inset }
  1. if you not opposed, we merge this PR as is, assuming that
  • no failing tests means no BC break
  • nobody cares about downscale because it's incorrect and has a working alternative thumbnail
  • if there is an implicit but significant case when BC break really occurs, someone will report that

@lsmith77
Copy link
Contributor

you convinced me .. lets merge. thx! :)

@lsmith77 lsmith77 merged commit 3cf8a3a into liip:master Jul 14, 2016
@lsmith77 lsmith77 removed the State: Reviewing This item is being reviewed to determine if it should be accepted. label Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants