From c7324f7e44d1d1bd5c39a9b967dff76b274b9048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 3 Apr 2014 12:00:53 +0200 Subject: [PATCH] fix float comparison for negative results --- lib/private/preview.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/preview.php b/lib/private/preview.php index 36cc5d9a2e..71c16687fb 100755 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -109,7 +109,7 @@ class Preview { * @brief returns the path of the file you want a thumbnail from * @return string */ - public function getFile() { + public function getFile() { return $this->file; } @@ -384,7 +384,7 @@ class Preview { $name = rtrim($thumbnail['name'], '.png'); list($x, $y, $aspectRatio) = $this->getDimensionsFromFilename($name); - if (($aspectRatio - $wantedAspectRatio) >= 0.000001 + if (abs($aspectRatio - $wantedAspectRatio) >= 0.000001 || $this->unscalable($x, $y) ) { continue;