fix float comparison for negative results

This commit is contained in:
Jörn Friedrich Dreyer 2014-04-03 12:00:53 +02:00
parent b9a8bd7e1f
commit c7324f7e44
1 changed files with 2 additions and 2 deletions

View File

@ -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;