DEV CommiDEV Committ
This commit is contained in:
1 parent
4541c58fe7
commit
c6759186cb
145 files changed
+2742
-579
No files matched your search
@@ -217,6 +217,20 @@ class DownloadcardJsonRenderer
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
$thumbnailUrl = null;
|
||||
try {
|
||||
$fileObj = GeneralUtility::makeInstance(TYPO3CMSCoreResourceResourceFactory::class)
|
||||
->getFileObject((int)$row["file_uid"]);
|
||||
$processed = $fileObj->process(
|
||||
TYPO3CMSCoreResourceProcessedFile::CONTEXT_IMAGEPREVIEW,
|
||||
["width" => 400, "height" => 566]
|
||||
);
|
||||
$thumbnailUrl = $processed->getPublicUrl();
|
||||
} catch (Throwable $e) {
|
||||
// ignore — keep null
|
||||
}
|
||||
|
||||
return [
|
||||
'uid' => (int)$row['uid'],
|
||||
'title' => (string)($row['title'] ?? ''),
|
||||
@@ -284,11 +298,26 @@ class DownloadcardJsonRenderer
|
||||
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'] ?? ''),
|
||||
'size' => (int)($row['size'] ?? 0),
|
||||
'thumbnail' => $thumbnailUrl,
|
||||
'size' => (int)($row['size'] ?? 0),
|
||||
'extension' => (string)($row['extension'] ?? ''),
|
||||
'mimeType' => (string)($row['mime_type'] ?? ''),
|
||||
'title' => (string)($row['title'] ?? ''),
|
||||
|
||||
Reference in new issue
Block a user