DEV CommiDEV Committ

This commit is contained in:
khaccount committed 2026-07-01 10:34:48 +02:00
1 parent 4541c58fe7
commit c6759186cb
145 files changed
+2742 -579

No files matched your search

@@ -212,6 +212,7 @@ class DownloadcardcollectionJsonRenderer
);
$srcset[] = [
'url' => $imageService->getImageUri($variant),
'thumbnail' => $thumbnailUrl,
'width' => $width,
'descriptor' => $width . 'w',
];
@@ -225,6 +226,7 @@ class DownloadcardcollectionJsonRenderer
return [
'uid' => (int)$fileRefData['uid'],
'url' => $imageService->getImageUri($default),
'thumbnail' => $thumbnailUrl,
'title' => $fileRefData['title'] ?? '',
'alternative' => $fileRefData['alternative'] ?? '',
'description' => $fileRefData['description'] ?? '',
@@ -297,10 +299,25 @@ class DownloadcardcollectionJsonRenderer
return null;
}
$thumbnailUrl = null;
try {
$fileObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Resource\ResourceFactory::class)
->getFileObject((int)$row['file_uid']);
$processed = $fileObj->process(
\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW,
['width' => 400, 'height' => 566]
);
$thumbnailUrl = $processed->getPublicUrl();
} catch (\Throwable $e) {
// ignore — keep null
}
return [
'uid' => (int)$row['file_uid'],
'name' => (string)($row['name'] ?? ''),
'url' => '/fileadmin' . ($row['identifier'] ?? ''),
'thumbnail' => $thumbnailUrl,
'size' => (int)($row['size'] ?? 0),
'extension' => (string)($row['extension'] ?? ''),
'mimeType' => (string)($row['mime_type'] ?? ''),