summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-05-08 12:40:20 +0200
committerJulius Härtl <jus@bitgrid.net>2018-06-05 16:47:38 +0200
commit9b919245f67f5511d6be7910f61d639b290eab26 (patch)
tree51dc22ed31709c7e78af630de298b548dba3f863 /apps/theming/lib
parent4a5826cddb19c8a3cd8c112eea29d87630591293 (diff)
downloadnextcloud-server-9b919245f67f5511d6be7910f61d639b290eab26.tar.gz
nextcloud-server-9b919245f67f5511d6be7910f61d639b290eab26.zip
Adjust ImageManager tests for png generation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/ImageManager.php9
1 files changed, 3 insertions, 6 deletions
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 {