summaryrefslogtreecommitdiffstats
path: root/lib/private/preview.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-04-03 12:00:53 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-04-03 12:00:53 +0200
commitc7324f7e44d1d1bd5c39a9b967dff76b274b9048 (patch)
tree04040eb1327f05badba6e8215e1be9eb8f6231da /lib/private/preview.php
parentb9a8bd7e1f6f99fe5d26e1693d13ebc6ddf81777 (diff)
downloadnextcloud-server-c7324f7e44d1d1bd5c39a9b967dff76b274b9048.tar.gz
nextcloud-server-c7324f7e44d1d1bd5c39a9b967dff76b274b9048.zip
fix float comparison for negative results
Diffstat (limited to 'lib/private/preview.php')
-rwxr-xr-xlib/private/preview.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/preview.php b/lib/private/preview.php
index 36cc5d9a2e0..71c16687fb9 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;