From 9b919245f67f5511d6be7910f61d639b290eab26 Mon Sep 17 00:00:00 2001 From: Julius Härtl <jus@bitgrid.net> Date: Tue, 8 May 2018 12:40:20 +0200 Subject: Adjust ImageManager tests for png generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl <jus@bitgrid.net> --- apps/theming/lib/ImageManager.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/theming/lib') diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 693d2bbe1d4..850cd3e69bd 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -33,9 +33,6 @@ use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\IURLGenerator; -/** - * @property IURLGenerator urlGenerator - */ class ImageManager { /** @var IConfig */ @@ -55,7 +52,7 @@ class ImageManager { * @param IConfig $config * @param IAppData $appData * @param IURLGenerator $urlGenerator - * @param ThemingDefaults $themingDefaults + * @param ICacheFactory $cacheFactory */ public function __construct(IConfig $config, IAppData $appData, @@ -97,10 +94,10 @@ class ImageManager { */ public function getImage(string $key, bool $useSvg = false): ISimpleFile { $logo = $this->config->getAppValue('theming', $key . 'Mime', false); - if ($logo === false) { + $folder = $this->appData->getFolder('images'); + if ($logo === false || !$folder->fileExists($key)) { throw new NotFoundException(); } - $folder = $this->appData->getFolder('images'); if (!$useSvg && $this->shouldReplaceIcons()) { if (!$folder->fileExists($key . '.png')) { try { -- cgit v1.2.3