Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Validator] Fix minRatio and maxRatio when getting rounded#45204

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fancyweb merged 1 commit intosymfony:4.4fromalexander-schranz:patch-10
Jan 31, 2022

Conversation

@alexander-schranz
Copy link
Contributor

@alexander-schranzalexander-schranz commentedJan 27, 2022
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

Currently the generated ratio get rounded to1.33 but the inputted ration not. This can end into a strange behaviour when working with example:

newImage(['maxRatio' =>64 /48,'minRatio' =>64 /48,]),

Workaround currently required rounding input value itself:

newImage([// round ratio the same way as the validator: https://github.com/symfony/symfony/blob/4834d9e224b97f946fe8e13b2ba403bbc212c4ad/src/Symfony/Component/Validator/Constraints/ImageValidator.php#L165'maxRatio' =>round(64 /48,2),'minRatio' =>round(64 /48,2),]),

Another solution would be removed:

-   $ratio = round($width / $height, 2);

instead. What do you think?

@nicolas-grekas
Copy link
Member

Needs tests :)

@alexander-schranz
Copy link
ContributorAuthor

@nicolas-grekas added :)

@fancyweb
Copy link
Contributor

Thank you@alexander-schranz.

@fancywebfancyweb merged commit19da12f intosymfony:4.4Jan 31, 2022
@alexander-schranzalexander-schranz deleted the patch-10 branchJanuary 31, 2022 09:25
This was referencedFeb 28, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+2 more reviewers

@johdcodejohdcodejohdcode requested changes

@fancywebfancywebfancyweb approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@alexander-schranz@nicolas-grekas@fancyweb@johdcode@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp