diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-11-04 10:08:36 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-11-04 10:08:36 +0100 |
commit | dd93532526f2de7f6c7ae1a2a7b76b0451be1844 (patch) | |
tree | ba055d998e9e99db778be99ffc528a81241716e9 /apps/theming | |
parent | 8eb0db5078944f8d0bea8b641f69437acf59e9ab (diff) | |
download | nextcloud-server-dd93532526f2de7f6c7ae1a2a7b76b0451be1844.tar.gz nextcloud-server-dd93532526f2de7f6c7ae1a2a7b76b0451be1844.zip |
Cleanup ImageManager::getImage()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/theming')
-rw-r--r-- | apps/theming/lib/ImageManager.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 7f9b410ff9c..469480d1e10 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -101,7 +101,6 @@ class ImageManager { * @throws NotPermittedException */ public function getImage(string $key, bool $useSvg = true): ISimpleFile { - $pngFile = null; $logo = $this->config->getAppValue('theming', $key . 'Mime', false); $folder = $this->appData->getFolder('images'); if ($logo === false || !$folder->fileExists($key)) { @@ -116,17 +115,14 @@ class ImageManager { $finalIconFile->setImageFormat('png32'); $pngFile = $folder->newFile($key . '.png'); $pngFile->putContent($finalIconFile->getImageBlob()); + return $pngFile; } catch (\ImagickException $e) { $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: ' . $e->getMessage()); - $pngFile = null; } } else { - $pngFile = $folder->getFile($key . '.png'); + return $folder->getFile($key . '.png'); } } - if ($pngFile !== null) { - return $pngFile; - } return $folder->getFile($key); } |