Project

General

Profile

Actions

Bug #81776

closed

Duplicated image thumbnails in file list, file picker and search

Added by Tymoteusz Motylewski over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-07-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

TYPO3 shows image thumbnails in file list module, search in file list module and file picker.

Unfortunately all these places generate unique thumbnail, which pollutes the sys_file_processedfile table as well as filesystem.
Dimensions of the images are the same.

File list:
responsible file:
typo3/cms/typo3/sysext/filelist/Classes/FileList.php

$processedFile = $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, [])

$thumbUrl = $processedFile->getPublicUrl(true);
$theData[$field] .= '<br /><img src="' . $thumbUrl . '" ' .
   'width="' . $processedFile->getProperty('width') . '" ' .
   'height="' . $processedFile->getProperty('height') . '" ' .
   'title="' . htmlspecialchars($fileName) . '" alt="" />';

generates image like /fileadmin/_processed_/0/3/preview_1_861a55d585.jpg
with empty configuration column in db, and "Image.Preview" as task_type

Search in filelist
- uses fluid template typo3/sysext/filelist/Resources/Private/Templates/FileList/Search.html
<f:image image="{file.resource}" maxWidth="64" maxHeight="43" />

result in file /fileadmin/_processed_/0/3/csm_1_461a7fe184.jpg
with configuration column in db like:

a:7:{s:5:"width";N;s:6:"height";N;s:8:"minWidth";N;s:9:"minHeight";N;s:8:"maxWidth";i:64;s:9:"maxHeight";i:43;s:4:"crop";N;}

task type: "Image.CropScaleMask"

file picker

responsible code: typo3/sysext/recordlist/Classes/Browser/FileBrowser.php

$processedFile = $fileObject->process(
    ProcessedFile::CONTEXT_IMAGEPREVIEW,
    ['width' => 64, 'height' => 64]
);
$imageUrl = $processedFile->getPublicUrl(true);
$imgInfo = [
    $fileObject->getProperty('width'),
    $fileObject->getProperty('height')
];
$clickIcon = '<img src="' . $imageUrl . '"'
    . '  width="' . $processedFile->getProperty('width') . '"'
    . ' height="' . $processedFile->getProperty('height') . '"'
    . ' hspace="5" vspace="5" border="1" />';

generates file like:
/fileadmin/_processed_/0/3/preview_1_dd144cea45.jpg

with configuration in db:

a:2:{s:5:"width";i:64;s:6:"height";i:64;}

"Image.Preview" as task_type


Files

sys_file_processedfile.png (63.4 KB) sys_file_processedfile.png Tymoteusz Motylewski, 2017-07-03 23:51

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #75284: TBE file selector - bad performance, very slowClosed2016-03-28

Actions
Related to TYPO3 Core - Bug #82098: Duplicated image thumbnails in file list search viewClosed2017-08-14

Actions
Related to TYPO3 Core - Bug #83242: thumbnail is regenerated every time when empty processing configuration is passedClosedTymoteusz Motylewski2017-12-06

Actions
Related to TYPO3 Core - Bug #83421: Fix preview processing APIClosed2017-12-24

Actions
Actions

Also available in: Atom PDF