diff options
19 files changed, 35 insertions, 41 deletions
diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 6a42c22aba5..46598673f14 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -80,12 +80,13 @@ class ImageManager { } switch ($key) { + case 'logo-blue': + // the blue logo is only available as svg + return $this->urlGenerator->getAbsoluteURL('svg/core/logo/logo/0082C9') . '?v=' . $cacheBusterCounter; case 'logo': case 'logoheader': case 'favicon': - return $this->urlGenerator->imagePath('core', 'logo.png') . '?v=' . $cacheBusterCounter; - case 'logo-blue': - return $this->urlGenerator->imagePath('core', 'logo-blue.png') . '?v=' . $cacheBusterCounter; + return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter; case 'background': return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter; } diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 5a14e8a7903..7a26b46516f 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -217,9 +217,9 @@ class ThemingDefaults extends \OC_Defaults { if(!$logo || !$logoExists) { if($useSvg) { - $logo = $this->urlGenerator->imagePath('core', 'logo.svg'); + $logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg'); } else { - $logo = $this->urlGenerator->imagePath('core', 'logo.png'); + $logo = $this->urlGenerator->imagePath('core', 'logo/logo.png'); } return $logo . '?v=' . $cacheBusterCounter; } @@ -312,9 +312,9 @@ class ThemingDefaults extends \OC_Defaults { $primaryColor = $this->getColorPrimary(); $luminance = $this->util->calculateLuminance($primaryColor); if ($logoMime === '' & $luminance > 0.8) { - return $this->imageManager->getImageUrl('logo-blue'); + return $this->imageManager->getImageUrl('logo-blue', true); } else { - return $this->imageManager->getImageUrl('logo'); + return $this->imageManager->getImageUrl('logo', true); } } diff --git a/apps/theming/tests/ImageManagerTest.php b/apps/theming/tests/ImageManagerTest.php index 38f5fb04969..fc9eac7f143 100644 --- a/apps/theming/tests/ImageManagerTest.php +++ b/apps/theming/tests/ImageManagerTest.php @@ -144,9 +144,9 @@ class ImageManagerTest extends TestCase { ->willReturnOnConsecutiveCalls(0, false); $this->urlGenerator->expects($this->once()) ->method('imagePath') - ->with('core', 'logo.png') - ->willReturn('logo.png'); - $this->assertEquals('logo.png?v=0', $this->imageManager->getImageUrl('logo')); + ->with('core', 'logo/logo.png') + ->willReturn('logo/logo.png'); + $this->assertEquals('logo/logo.png?v=0', $this->imageManager->getImageUrl('logo')); } public function testGetImageUrlAbsolute() { diff --git a/apps/theming/tests/ThemingDefaultsTest.php b/apps/theming/tests/ThemingDefaultsTest.php index fc3a737c3c8..3da39fbbf2f 100644 --- a/apps/theming/tests/ThemingDefaultsTest.php +++ b/apps/theming/tests/ThemingDefaultsTest.php @@ -593,11 +593,11 @@ class ThemingDefaultsTest extends TestCase { } public function testGetLogoDefaultWithSvg() { - $this->getLogoHelper('logo.svg', true); + $this->getLogoHelper('logo/logo.svg', true); } public function testGetLogoDefaultWithoutSvg() { - $this->getLogoHelper('logo.png', false); + $this->getLogoHelper('logo/logo.png', false); } public function testGetLogoCustom() { diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php index 09b6fe54384..fed97177eef 100644 --- a/core/Controller/LoginController.php +++ b/core/Controller/LoginController.php @@ -194,7 +194,7 @@ class LoginController extends Controller { Util::addHeader('meta', ['property' => 'og:site_name', 'content' => Util::sanitizeHTML($this->defaults->getName())]); Util::addHeader('meta', ['property' => 'og:url', 'content' => $this->urlGenerator->getAbsoluteURL('/')]); Util::addHeader('meta', ['property' => 'og:type', 'content' => 'website']); - Util::addHeader('meta', ['property' => 'og:image', 'content' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core','favicon-touch.png'))]); + Util::addHeader('meta', ['property' => 'og:image', 'content' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-touch.png'))]); return new TemplateResponse( $this->appName, 'login', $parameters, 'guest' diff --git a/core/Controller/SvgController.php b/core/Controller/SvgController.php index 1fad9c39c3b..f0fc1dac4d4 100644 --- a/core/Controller/SvgController.php +++ b/core/Controller/SvgController.php @@ -91,7 +91,7 @@ class SvgController extends Controller { $appRootPath = $this->appManager->getAppPath($app); $appPath = substr($appRootPath, strlen($this->serverRoot)); - + if (!$appPath) { return new NotFoundResponse(); } @@ -119,8 +119,7 @@ class SvgController extends Controller { } // add fill (fill is not present on black elements) - $fillRe = '/<((circle|rect|path)((?!fill)[a-z0-9 =".\-#():;])+)\/>/mi'; - + $fillRe = '/<((circle|rect|path)((!fill)[a-z0-9 =".\-#():;])+)\/>/mi'; $svg = preg_replace($fillRe, '<$1 fill="#' . $color . '"/>', $svg); // replace any fill or stroke colors diff --git a/core/css/guest.css b/core/css/guest.css index fc926688c44..52386e904c7 100644 --- a/core/css/guest.css +++ b/core/css/guest.css @@ -69,7 +69,7 @@ body { } #header .logo { - background-image: url('../img/logo.svg?v=1'); + background-image: url('../img/logo/logo.svg?v=1'); background-repeat: no-repeat; background-size: 175px; background-position: center; diff --git a/core/img/logo-blue.png b/core/img/logo-blue.png Binary files differdeleted file mode 100644 index e1b7352b3f6..00000000000 --- a/core/img/logo-blue.png +++ /dev/null diff --git a/core/img/logo.svg b/core/img/logo.svg deleted file mode 100644 index 1d52d93b0f2..00000000000 --- a/core/img/logo.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="256" viewBox="0 0 256 128" ><g stroke="#fff" stroke-width="22" fill="none"><circle cy="64" cx="40" r="26"/><circle cy="64" cx="216" r="26"/><circle cy="64" cx="128" r="46"/></g></svg> diff --git a/core/img/logo-icon-175px.png b/core/img/logo/logo-icon-175px.png Binary files differindex 6397f61cd68..6397f61cd68 100644 --- a/core/img/logo-icon-175px.png +++ b/core/img/logo/logo-icon-175px.png diff --git a/core/img/logo-mail.png b/core/img/logo/logo-mail.png Binary files differindex 80304ae7ec7..80304ae7ec7 100644 --- a/core/img/logo-mail.png +++ b/core/img/logo/logo-mail.png diff --git a/core/img/logo.png b/core/img/logo/logo.png Binary files differindex df32e1c7eab..df32e1c7eab 100644 --- a/core/img/logo.png +++ b/core/img/logo/logo.png diff --git a/core/img/logo-blue.svg b/core/img/logo/logo.svg index 66b17330d12..dda265dfa16 100644 --- a/core/img/logo-blue.svg +++ b/core/img/logo/logo.svg @@ -12,7 +12,7 @@ width="256" viewBox="0 0 256 128" id="svg10" - sodipodi:docname="logo-blue.svg" + sodipodi:docname="logo.svg" inkscape:version="0.92.3 (2405546, 2018-03-11)"> <metadata id="metadata16"> @@ -22,7 +22,6 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -43,7 +42,7 @@ showgrid="false" inkscape:zoom="1.4296875" inkscape:cx="128" - inkscape:cy="64" + inkscape:cy="91.978142" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -52,25 +51,21 @@ stroke="#fff" stroke-width="22" fill="none" - id="g8" - style="stroke:#0082c9;stroke-opacity:1"> + id="g8"> <circle cy="64" cx="40" r="26" - id="circle2" - style="stroke:#0082c9;stroke-opacity:1" /> + id="circle2" /> <circle cy="64" cx="216" r="26" - id="circle4" - style="stroke:#0082c9;stroke-opacity:1" /> + id="circle4" /> <circle cy="64" cx="128" r="46" - id="circle6" - style="stroke:#0082c9;stroke-opacity:1" /> + id="circle6" /> </g> </svg> diff --git a/lib/private/legacy/defaults.php b/lib/private/legacy/defaults.php index 3a22c91a8df..0c95c1b81b7 100644 --- a/lib/private/legacy/defaults.php +++ b/lib/private/legacy/defaults.php @@ -315,9 +315,9 @@ class OC_Defaults { } if($useSvg) { - $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo.svg'); + $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.svg'); } else { - $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo.png'); + $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.png'); } return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion())); } diff --git a/tests/lib/Files/Cache/ScannerTest.php b/tests/lib/Files/Cache/ScannerTest.php index 075716f8033..736df2174d1 100644 --- a/tests/lib/Files/Cache/ScannerTest.php +++ b/tests/lib/Files/Cache/ScannerTest.php @@ -60,7 +60,7 @@ class ScannerTest extends \Test\TestCase { $this->assertEquals($cachedData['mimetype'], 'text/plain'); $this->assertNotEquals($cachedData['parent'], -1); //parent folders should be scanned automatically - $data = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); + $data = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $this->storage->file_put_contents('foo.png', $data); $this->scanner->scanFile('foo.png'); @@ -98,7 +98,7 @@ class ScannerTest extends \Test\TestCase { private function fillTestFolders() { $textData = "dummy file data\n"; - $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); + $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $this->storage->mkdir('folder'); $this->storage->file_put_contents('foo.txt', $textData); $this->storage->file_put_contents('foo.png', $imgData); diff --git a/tests/lib/Files/Cache/UpdaterLegacyTest.php b/tests/lib/Files/Cache/UpdaterLegacyTest.php index 707ed70af23..66fa8d51932 100644 --- a/tests/lib/Files/Cache/UpdaterLegacyTest.php +++ b/tests/lib/Files/Cache/UpdaterLegacyTest.php @@ -42,7 +42,7 @@ class UpdaterLegacyTest extends \Test\TestCase { $this->storage = new \OC\Files\Storage\Temporary(array()); $textData = "dummy file data\n"; - $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); + $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $this->storage->mkdir('folder'); $this->storage->file_put_contents('foo.txt', $textData); $this->storage->file_put_contents('foo.png', $imgData); @@ -84,7 +84,7 @@ class UpdaterLegacyTest extends \Test\TestCase { public function testWrite() { $textSize = strlen("dummy file data\n"); - $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png'); + $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $this->cache->put('foo.txt', array('mtime' => 100, 'storage_mtime' => 150)); $rootCachedData = $this->cache->get(''); $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']); @@ -145,7 +145,7 @@ class UpdaterLegacyTest extends \Test\TestCase { public function testDelete() { $textSize = strlen("dummy file data\n"); - $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png'); + $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $rootCachedData = $this->cache->get(''); $oldEtag = $rootCachedData['etag']; $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']); @@ -206,7 +206,7 @@ class UpdaterLegacyTest extends \Test\TestCase { public function testRename() { $textSize = strlen("dummy file data\n"); - $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png'); + $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $rootCachedData = $this->cache->get(''); $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']); diff --git a/tests/lib/Files/Cache/WatcherTest.php b/tests/lib/Files/Cache/WatcherTest.php index 3834b5591ff..d4aa9ac875e 100644 --- a/tests/lib/Files/Cache/WatcherTest.php +++ b/tests/lib/Files/Cache/WatcherTest.php @@ -179,7 +179,7 @@ class WatcherTest extends \Test\TestCase { private function getTestStorage($scan = true) { $storage = new \OC\Files\Storage\Temporary(array()); $textData = "dummy file data\n"; - $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); + $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $storage->mkdir('folder'); $storage->file_put_contents('foo.txt', $textData); $storage->file_put_contents('foo.png', $imgData); diff --git a/tests/lib/Files/ObjectStore/NoopScannerTest.php b/tests/lib/Files/ObjectStore/NoopScannerTest.php index 16bd325a8df..6d593225e97 100644 --- a/tests/lib/Files/ObjectStore/NoopScannerTest.php +++ b/tests/lib/Files/ObjectStore/NoopScannerTest.php @@ -38,7 +38,7 @@ class NoopScannerTest extends \Test\TestCase { private function fillTestFolders() { $textData = "dummy file data\n"; - $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); + $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $this->storage->mkdir('folder'); $this->storage->file_put_contents('foo.txt', $textData); $this->storage->file_put_contents('foo.png', $imgData); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 9b435f2b935..97e3d42684f 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -142,7 +142,7 @@ class ViewTest extends \Test\TestCase { Filesystem::mount($storage2, array(), $root . '/substorage'); Filesystem::mount($storage3, array(), $root . '/folder/anotherstorage'); $textSize = strlen("dummy file data\n"); - $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png'); + $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $storageSize = $textSize * 2 + $imageSize; $storageInfo = $storage3->getCache()->get(''); @@ -658,7 +658,7 @@ class ViewTest extends \Test\TestCase { */ $storage = new $class(array()); $textData = "dummy file data\n"; - $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png'); + $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png'); $storage->mkdir('folder'); $storage->file_put_contents('foo.txt', $textData); $storage->file_put_contents('foo.png', $imgData); |