summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/ThemingDefaults.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/lib/ThemingDefaults.php')
-rw-r--r--apps/theming/lib/ThemingDefaults.php21
1 files changed, 5 insertions, 16 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 00c47676bc8..a46676a43a9 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -205,7 +205,7 @@ class ThemingDefaults extends \OC_Defaults {
$logoExists = true;
try {
- $this->imageManager->getImage('logo');
+ $this->imageManager->getImage('logo', $useSvg);
} catch (\Exception $e) {
$logoExists = false;
}
@@ -221,7 +221,7 @@ class ThemingDefaults extends \OC_Defaults {
return $logo . '?v=' . $cacheBusterCounter;
}
- return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo' ]) . '?v=' . $cacheBusterCounter;
+ return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]);
}
/**
@@ -339,23 +339,12 @@ class ThemingDefaults extends \OC_Defaults {
* Check if Imagemagick is enabled and if SVG is supported
* otherwise we can't render custom icons
*
+ * TODO: move to usage of image manager
+ *
* @return bool
*/
public function shouldReplaceIcons() {
- $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl());
- if($value = $cache->get('shouldReplaceIcons')) {
- return (bool)$value;
- }
- $value = false;
- if(extension_loaded('imagick')) {
- $checkImagick = new \Imagick();
- if (count($checkImagick->queryFormats('SVG')) >= 1) {
- $value = true;
- }
- $checkImagick->clear();
- }
- $cache->set('shouldReplaceIcons', $value);
- return $value;
+ return $this->imageManager->shouldReplaceIcons();
}
/**