aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/IconBuilder.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-05-18 23:30:02 +0200
committerGitHub <noreply@github.com>2017-05-18 23:30:02 +0200
commitc60547295025eec862ee1ea9a3f5009f901f8bc2 (patch)
tree7646d1df52473e5adc4be3903971ab50e670a9fc /apps/theming/lib/IconBuilder.php
parent10930c9ff29fb551d50a2dc29a61d18e61602d15 (diff)
parent489131333ab2db67d84baca623f3649336f417c1 (diff)
downloadnextcloud-server-c60547295025eec862ee1ea9a3f5009f901f8bc2.tar.gz
nextcloud-server-c60547295025eec862ee1ea9a3f5009f901f8bc2.zip
Merge pull request #4888 from nextcloud/theming-fallback-icons
Fallback to default favicon
Diffstat (limited to 'apps/theming/lib/IconBuilder.php')
-rw-r--r--apps/theming/lib/IconBuilder.php32
1 files changed, 20 insertions, 12 deletions
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index 42a7031f405..4383ccc7cd9 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -53,14 +53,18 @@ class IconBuilder {
* @return string|false image blob
*/
public function getFavicon($app) {
- $icon = $this->renderAppIcon($app, 32);
- if($icon === false) {
+ try {
+ $icon = $this->renderAppIcon($app, 32);
+ if ($icon === false) {
+ return false;
+ }
+ $icon->setImageFormat("png24");
+ $data = $icon->getImageBlob();
+ $icon->destroy();
+ return $data;
+ } catch (\ImagickException $e) {
return false;
}
- $icon->setImageFormat("png24");
- $data = $icon->getImageBlob();
- $icon->destroy();
- return $data;
}
/**
@@ -68,14 +72,18 @@ class IconBuilder {
* @return string|false image blob
*/
public function getTouchIcon($app) {
- $icon = $this->renderAppIcon($app, 512);
- if($icon === false) {
+ try {
+ $icon = $this->renderAppIcon($app, 512);
+ if ($icon === false) {
+ return false;
+ }
+ $icon->setImageFormat("png24");
+ $data = $icon->getImageBlob();
+ $icon->destroy();
+ return $data;
+ } catch (\ImagickException $e) {
return false;
}
- $icon->setImageFormat("png24");
- $data = $icon->getImageBlob();
- $icon->destroy();
- return $data;
}
/**