@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
76 | 76 | try { |
77 | 77 | $image = $this->getImage($key, $useSvg); |
78 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $key ]) . '?v=' . $cacheBusterCounter; |
|
78 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => $key]).'?v='.$cacheBusterCounter; |
|
79 | 79 | } catch (NotFoundException $e) { |
80 | 80 | } |
81 | 81 | |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | case 'logo': |
84 | 84 | case 'logoheader': |
85 | 85 | case 'favicon': |
86 | - return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter; |
|
86 | + return $this->urlGenerator->imagePath('core', 'logo/logo.png').'?v='.$cacheBusterCounter; |
|
87 | 87 | case 'background': |
88 | - return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter; |
|
88 | + return $this->urlGenerator->imagePath('core', 'background.png').'?v='.$cacheBusterCounter; |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -102,26 +102,26 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function getImage(string $key, bool $useSvg = true): ISimpleFile { |
104 | 104 | $pngFile = null; |
105 | - $logo = $this->config->getAppValue('theming', $key . 'Mime', false); |
|
105 | + $logo = $this->config->getAppValue('theming', $key.'Mime', false); |
|
106 | 106 | $folder = $this->appData->getFolder('images'); |
107 | 107 | if ($logo === false || !$folder->fileExists($key)) { |
108 | 108 | throw new NotFoundException(); |
109 | 109 | } |
110 | 110 | if (!$useSvg && $this->shouldReplaceIcons()) { |
111 | - if (!$folder->fileExists($key . '.png')) { |
|
111 | + if (!$folder->fileExists($key.'.png')) { |
|
112 | 112 | try { |
113 | 113 | $finalIconFile = new \Imagick(); |
114 | 114 | $finalIconFile->setBackgroundColor('none'); |
115 | 115 | $finalIconFile->readImageBlob($folder->getFile($key)->getContent()); |
116 | 116 | $finalIconFile->setImageFormat('png32'); |
117 | - $pngFile = $folder->newFile($key . '.png'); |
|
117 | + $pngFile = $folder->newFile($key.'.png'); |
|
118 | 118 | $pngFile->putContent($finalIconFile->getImageBlob()); |
119 | 119 | } catch (\ImagickException $e) { |
120 | - $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: ' . $e->getMessage()); |
|
120 | + $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: '.$e->getMessage()); |
|
121 | 121 | $pngFile = null; |
122 | 122 | } |
123 | 123 | } else { |
124 | - $pngFile = $folder->getFile($key . '.png'); |
|
124 | + $pngFile = $folder->getFile($key.'.png'); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | if ($pngFile !== null) { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $images = []; |
135 | 135 | foreach ($this->supportedImageKeys as $key) { |
136 | 136 | $images[$key] = [ |
137 | - 'mime' => $this->config->getAppValue('theming', $key . 'Mime', ''), |
|
137 | + 'mime' => $this->config->getAppValue('theming', $key.'Mime', ''), |
|
138 | 138 | 'url' => $this->getImageUrl($key), |
139 | 139 | ]; |
140 | 140 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } catch (NotPermittedException $e) { |
201 | 201 | } |
202 | 202 | try { |
203 | - $file = $this->appData->getFolder('images')->getFile($key . '.png'); |
|
203 | + $file = $this->appData->getFolder('images')->getFile($key.'.png'); |
|
204 | 204 | $file->delete(); |
205 | 205 | } catch (NotFoundException $e) { |
206 | 206 | } catch (NotPermittedException $e) { |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | imagealphablending($newImage, true); |
234 | 234 | |
235 | 235 | $tmpFile = $this->tempManager->getTemporaryFile(); |
236 | - $newWidth = (int)(imagesx($newImage) < 4096 ? imagesx($newImage) : 4096); |
|
237 | - $newHeight = (int)(imagesy($newImage) / (imagesx($newImage) / $newWidth)); |
|
236 | + $newWidth = (int) (imagesx($newImage) < 4096 ? imagesx($newImage) : 4096); |
|
237 | + $newHeight = (int) (imagesy($newImage) / (imagesx($newImage) / $newWidth)); |
|
238 | 238 | $outputImage = imagescale($newImage, $newWidth, $newHeight); |
239 | 239 | |
240 | 240 | imageinterlace($outputImage, 1); |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | * @return bool |
296 | 296 | */ |
297 | 297 | public function shouldReplaceIcons() { |
298 | - $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl()); |
|
298 | + $cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl()); |
|
299 | 299 | if ($value = $cache->get('shouldReplaceIcons')) { |
300 | - return (bool)$value; |
|
300 | + return (bool) $value; |
|
301 | 301 | } |
302 | 302 | $value = false; |
303 | 303 | if (extension_loaded('imagick')) { |