From d525c4938eaaf501d91ca851c6acb76f8be4419e Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 19 Sep 2016 17:20:55 +0100 Subject: [PATCH] Small fixes Hit --- src/Models/Hit.php | 16 +++++++++++++++- www/faces3.php | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Models/Hit.php b/src/Models/Hit.php index cb377ff..f7c7051 100644 --- a/src/Models/Hit.php +++ b/src/Models/Hit.php @@ -213,13 +213,27 @@ class Hit return realpath(__DIR__ . "/../../files/hits/".$feature) ; } + + + /** + * @param string $feature + * @return string|false false if not exists + * @throws \Exception + */ + public function getFeatureFilename(string $feature) { + $dir = $this->getFeatureDirname($feature); + + return $dir . '/'.$this->getId().'.jpg'; + } + + /** * @param string $feature * @return string|null */ public function getFeatureImgAsString($feature) { - $filename = $this->getFeatureDirname($feature) .'/'.$this->getId().'.jpg'; + $filename = $this->getFeatureFilename($feature); if(!file_exists($filename)) { return null; } diff --git a/www/faces3.php b/www/faces3.php index 88bac09..44da2ef 100644 --- a/www/faces3.php +++ b/www/faces3.php @@ -72,6 +72,7 @@ font-size:80%; .mouth .emo-block{ width:50%; float:left; + height:12%; } .mouth .emotitle{ display:block;