summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/IconBuilder.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-05-14 23:48:51 +0200
committerJulius Härtl <jus@bitgrid.net>2017-05-17 10:11:29 +0200
commit1157f413c9a5c89994f0477b97726a2aef64e44e (patch)
treecb95f5c237e5f7a8584e4cc84f04396e45ed7fc2 /apps/theming/lib/IconBuilder.php
parent443cbdc73931c0deec5bc01634ec9b512486d769 (diff)
downloadnextcloud-server-1157f413c9a5c89994f0477b97726a2aef64e44e.tar.gz
nextcloud-server-1157f413c9a5c89994f0477b97726a2aef64e44e.zip
Fallback to default favicon
Signed-off-by: Julius Härtl <jus@bitgrid.net>
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 7db24c4a2b0..477ba966c64 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -52,14 +52,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;
}
/**
@@ -67,14 +71,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;
}
/**