diff --git a/themes/bs_bootstrap/bs_bootstrap.theme b/themes/bs_bootstrap/bs_bootstrap.theme
index a1d5309..56c2e2f 100644
--- a/themes/bs_bootstrap/bs_bootstrap.theme
+++ b/themes/bs_bootstrap/bs_bootstrap.theme
@@ -8,7 +8,6 @@
 use Drupal\block\Entity\Block;
 use Drupal\bs_bootstrap\BsBootstrapFormAlter;
 use Drupal\Component\Utility\NestedArray;
-use Drupal\Component\Utility\Xss;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Core\Render\Element;
@@ -384,9 +383,27 @@ function bs_bootstrap_preprocess_block(&$variables) {
           // so assistive device are not confused in this case.
           $logo_attributes['role'] = 'img';
 
-          // Inline SVG logo.
-          if (bs_bootstrap_get_setting('logo_svg_inline')) {
-            $variables['site_logo_svg'] = file_get_contents(DRUPAL_ROOT . $variables['site_logo']);
+          if (file_exists(DRUPAL_ROOT . $variables['site_logo'])) {
+            $svg_content = file_get_contents(DRUPAL_ROOT . $variables['site_logo']);
+
+            // Inline SVG logo.
+            if (bs_bootstrap_get_setting('logo_svg_inline')) {
+              $variables['site_logo_svg'] = $svg_content;
+            }
+            // For img SVG get the logo width and height from SVG.
+            elseif (\Drupal::getContainer()->has('bs_lib.svg_tools')) {
+              /** @var \Drupal\bs_lib\SvgTools $svg_tools */
+              $svg_tools = \Drupal::service('bs_lib.svg_tools');
+              if ($dimensions = $svg_tools->getDimensions($svg_content)) {
+                // Browsers are allowing float numbers for img width and height
+                // but currently HTML specification requires that this values
+                // must be valid non-negative integers.
+                // @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-width
+                // @see https://github.com/whatwg/html/issues/533
+                $logo_attributes['width'] = ceil($dimensions['width']);
+                $logo_attributes['height'] = ceil($dimensions['height']);
+              }
+            }
           }
         }
         else {
