Skip to content

Commit

Permalink
[BUGFIX] Enforce processing images stored in typo3temp
Browse files Browse the repository at this point in the history
When rendering preview images of online-media assets (YouTube, etc.),
the corresponding image is retrieved from the remote host and stored
in typo3temp. In case configured dimension and file extension of the
target file are not different, the image won't be processed and thus
not stored in a public FAL storage.

Resolves: #99550
Releases: main, 11.5
Change-Id: Ib2e28b2e5d2bc4ea96207917ca8f26f407f53856
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77543
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
  • Loading branch information
ohader committed Jan 23, 2023
1 parent 55b7227 commit 94a90d4
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -122,7 +122,9 @@ public function processWithLocalFile(TaskInterface $task, string $originalFileNa
$configuration['height'] ?? '',
$configuration['additionalParameters'],
$configuration['frame'] ?? '',
$options
$options,
// in case file is in `/typo3temp/`, it must create a result
$this->isTemporaryFile($originalFileName)
);
} else {
$targetFileName = $this->getFilenameForImageCropScaleMask($task);
Expand Down Expand Up @@ -283,4 +285,9 @@ protected function modifyImageMagickStripProfileParameters(string $parameters, a
}
return $parameters;
}

protected function isTemporaryFile(string $filePath): bool
{
return str_starts_with($filePath, Environment::getPublicPath() . '/typo3temp/');
}
}

0 comments on commit 94a90d4

Please sign in to comment.