compare floats with epsilon

This commit is contained in:
Jörn Friedrich Dreyer 2014-04-02 17:32:27 +02:00
parent 16d10844cd
commit b8248f4a0a
1 changed files with 2 additions and 1 deletions

View File

@ -355,7 +355,8 @@ class Preview {
$y = (int)$size[1];
$aspectRatio = (float)($x / $y);
if ($aspectRatio !== $wantedAspectRatio) {
$epsilon = 0.000001;
if (($aspectRatio - $wantedAspectRatio) >= $epsilon) {
continue;
}