Skip to content

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