Commit b93845f4 authored by Josef Glatz's avatar Josef Glatz Committed by Georg Ringer
Browse files

[BUGFIX] Set dimensions for custom svg TYPO3 backend logo

Width and height is automatically set for pixel based backend
logos. This patch makes sure this also is done for svg file format.

Releases: master, 7.6
Resolves: #78590
Change-Id: Iff1dddc827d002e10fd4ec6f3b57bc16920b1c86
Reviewed-on: https://review.typo3.org/50522

Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 46c1c10c
......@@ -22,6 +22,7 @@ use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\File\ImageInfo;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
......@@ -276,7 +277,10 @@ class BackendController
$logoWidth = 22;
$logoHeight = 22;
} else {
list($logoWidth, $logoHeight) = @getimagesize($logoPath);
// set width/height for custom logo
$imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $logoPath);
$logoWidth = $imageInfo->getWidth() ?? '22';
$logoHeight = $imageInfo->getHeight() ?? '22';
// High-resolution?
if (strpos($logoPath, '@2x.') !== false) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment