Bug #81776

Duplicated image thumbnails in file list, file picker and search

Added by Tymoteusz Motylewski over 2 years ago. Updated about 1 year ago.

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

100%

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

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


Related issues

Related to TYPO3 Core - Bug #75284: TBE file selector - bad performance, very slow Closed 2016-03-28
Related to TYPO3 Core - Bug #82098: Duplicated image thumbnails in file list search view New 2017-08-14
Related to TYPO3 Core - Bug #83242: thumbnail is regenerated every time when empty processing configuration is passed Closed 2017-12-06
Related to TYPO3 Core - Bug #83421: Fix preview processing API Closed 2017-12-24

Associated revisions

Revision 755e0ed0 (diff)
Added by Tymoteusz Motylewski over 2 years ago

[BUGFIX] Don't duplicate thumbnails in file list and file selector

Default width and height for thumbnails is now applied in ProcessedFile
thus configuration column of the sys_file_processedfile table is filled
even if empty configuration was passed to File->Process().

This prevents thumbnails with the same content but different names being
generated, thus improves performance.

Resolves: #81776
Releases: master, 8.7, 7.6
Change-Id: Ie001e3d6404b52c251d9ed24bcac461ed75050b8
Reviewed-on: https://review.typo3.org/53399
Tested-by: TYPO3com <>
Reviewed-by: Frans Saris <>
Tested-by: Frans Saris <>
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>

Revision ade023a0 (diff)
Added by Tymoteusz Motylewski over 2 years ago

[BUGFIX] Don't duplicate thumbnails in file list and file selector

Default width and height for thumbnails is now applied in ProcessedFile
thus configuration column of the sys_file_processedfile table is filled
even if empty configuration was passed to File->Process().

This prevents thumbnails with the same content but different names being
generated, thus improves performance.

Resolves: #81776
Releases: master, 8.7, 7.6
Change-Id: Ie001e3d6404b52c251d9ed24bcac461ed75050b8
Reviewed-on: https://review.typo3.org/53508
Tested-by: TYPO3com <>
Reviewed-by: Tymoteusz Motylewski <>
Tested-by: Tymoteusz Motylewski <>

Revision 7f452fc0 (diff)
Added by Tymoteusz Motylewski over 2 years ago

[BUGFIX] Don't duplicate thumbnails in file list and file selector

Default width and height for thumbnails is now applied in ProcessedFile
thus configuration column of the sys_file_processedfile table is filled
even if empty configuration was passed to File->Process().

This prevents thumbnails with the same content but different names being
generated, thus improves performance.

Resolves: #81776
Releases: master, 8.7, 7.6
Change-Id: Ie001e3d6404b52c251d9ed24bcac461ed75050b8
Reviewed-on: https://review.typo3.org/53509
Tested-by: TYPO3com <>
Reviewed-by: Tymoteusz Motylewski <>
Tested-by: Tymoteusz Motylewski <>

Revision c2c8790a (diff)
Added by Helmut Hummel almost 2 years ago

[TASK] Move changing preview processing config to processing service

Instead of complementing processing configuration in the file class,
move it to the processing service and LocalPreviewHelper class
to not have the code and logic duplicated and to ensure it is
always executed, not only when using the file API.

Resolves: #83421
Related: #81776
Related: #83242
Releases: master, 8.7, 7.6
Change-Id: I9b3f380625756137a56e7ad0ea55d21f47464ab8
Reviewed-on: https://review.typo3.org/55210
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

Revision 07ef3630 (diff)
Added by Helmut Hummel over 1 year ago

[TASK] Move changing preview processing config to processing service

Instead of complementing processing configuration in the file class,
move it to the processing service and LocalPreviewHelper class
to not have the code and logic duplicated and to ensure it is
always executed, not only when using the file API.

Resolves: #83421
Related: #81776
Related: #83242
Releases: master, 8.7, 7.6
Change-Id: I9b3f380625756137a56e7ad0ea55d21f47464ab8
Reviewed-on: https://review.typo3.org/55271
Tested-by: TYPO3com <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

Revision 4ab5437b (diff)
Added by Helmut Hummel over 1 year ago

[TASK] Move changing preview processing config to processing service

Instead of complementing processing configuration in the file class,
move it to the processing service and LocalPreviewHelper class
to not have the code and logic duplicated and to ensure it is
always executed, not only when using the file API.

Resolves: #83421
Related: #81776
Related: #83242
Releases: master, 8.7, 7.6
Change-Id: I9b3f380625756137a56e7ad0ea55d21f47464ab8
Reviewed-on: https://review.typo3.org/55270
Tested-by: TYPO3com <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#2 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53399

#3 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53399

#4 Updated by Tymoteusz Motylewski over 2 years ago

  • Related to Bug #75284: TBE file selector - bad performance, very slow added

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53399

#6 Updated by Tymoteusz Motylewski over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53508

#8 Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53509

#9 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53509

#10 Updated by Tymoteusz Motylewski over 2 years ago

  • Status changed from Under Review to Resolved

#11 Updated by Tymoteusz Motylewski about 2 years ago

  • Related to Bug #82098: Duplicated image thumbnails in file list search view added

#12 Updated by Tymoteusz Motylewski almost 2 years ago

  • Related to Bug #83242: thumbnail is regenerated every time when empty processing configuration is passed added

#13 Updated by Helmut Hummel almost 2 years ago

  • Related to Bug #83421: Fix preview processing API added

#14 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF