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

[5.4] Fix image dimension ratio check #17943

Merged
merged 1 commit into from
Feb 15, 2017
Merged

[5.4] Fix image dimension ratio check #17943

merged 1 commit into from
Feb 15, 2017

Conversation

Hugome
Copy link
Contributor

@Hugome Hugome commented Feb 15, 2017

Fix image ratio check :
Fail case with an image of dimension 400x400 and validator rule like :

dimensions:ratio=1
or
dimensions:ratio=1/1

Give in failsRatioCheck:

$numerator = 1.0; // Float
$denominator = 1; // Int
$numerator / $denominator; // Give a float

$width = 400; // Int from failsRatioCheck args
$height = 400; // Int from failsRatioCheck args
$width / $height // Give a int

return $numerator / $denominator !== $width / $height // Give true for (1.0 / 1 !== 400 / 400)

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