Skip to content
Snippets Groups Projects
Commit 175e11d0 authored by Helmut Hummel's avatar Helmut Hummel
Browse files

[TASK] Improve and fix ThumbnailController

The ThumbnailController outputs raw data of image files
as a response to a file process request.
This is a massive and unnecessary performance hit, when using
a remote storage, as the files need to get downloaded from
the remote to be then delivered by TYPO3.

This is now changed to simply redirect to the file URL.

Also the mime-type check for images is replaced with
an isImage() call to the processed file, in order
to also properly deliver thumbnails of PDF files.

Also clarify in code, that ProcessedFile::CONTEXT_IMAGEPREVIEW
isn't capable of handling any other processing instruction
than "width" and "height".

Also fix delivering an icon as thumbnail,
when the processed file isn't an image.

Last but not least, fix the 404 response by using
a HtmlResponse instead of a plain Response object,
because the plain Response object needs a resource
and cannot deal with plain strings.

Releases: master, 10.4, 9.5
Resolves: #91976
Change-Id: I218a8ba29ae0790be2603e8fab72f4eef1b8a47b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65279


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarJörg Bösche <typo3@joergboesche.de>
Tested-by: default avatarHelmut Hummel <typo3@helhum.io>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarJörg Bösche <typo3@joergboesche.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarHelmut Hummel <typo3@helhum.io>
parent da657436
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment