Jelajahi Sumber

fix image uri building and logo size

Olivier Massot 1 tahun lalu
induk
melakukan
01564d1825

+ 6 - 1
ot_core/Classes/Service/OpentalentImageService.php

@@ -10,6 +10,8 @@ class OpentalentImageService
     public const IMAGE_MD = 'md';
     public const IMAGE_LG = 'lg';
 
+    private OpentalentApiService $apiService;
+
     public function __construct(
         OpentalentApiService $apiService = null
     )
@@ -22,7 +24,10 @@ class OpentalentImageService
             throw new \RuntimeException('Invalid $size : ' . $size);
         }
 
-        $path = $this->apiService->getBody("api/public/files/$fileId/download/$size", ['relativePath' => true]);
+        $url = $this->apiService->getApiUri("api/public/files/$fileId/download/$size");
+
+        $path = $this->apiService->getBody($url, ['relativePath' => true]);
+
         return $this->apiService->getApiUri($path, true);
     }
 }

+ 1 - 1
ot_templating/Resources/Private/Partials/Classic/Topbar.html

@@ -6,7 +6,7 @@
     <div class="topbar-logo">
         <f:if condition="{settings.structureLogoId}">
             <a href="{ot:rootPage.getUri()}" title="{settings.structureName}">
-                <img src="{ot:image.getSrcById(fileId: settings.structureLogoId, size: 'sm')}" alt="{settings.structureName}"/>
+                <img src="{ot:image.getSrcById(fileId: settings.structureLogoId, size: 'md')}" alt="{settings.structureName}"/>
             </a>
         </f:if>
     </div>