[BUGFIX] Don't duplicate thumbnails in file list and file selector
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / ProcessedFile.php
index 617bd75..73d1e8f 100644 (file)
@@ -118,6 +118,11 @@ class ProcessedFile extends AbstractFile
         $this->originalFileSha1 = $this->originalFile->getSha1();
         $this->storage = $originalFile->getStorage()->getProcessingFolder()->getStorage();
         $this->taskType = $taskType;
+        if ($taskType === self::CONTEXT_IMAGEPREVIEW) {
+            $processingConfiguration = array_merge(['width' => 64, 'height' => 64], $processingConfiguration);
+            $processingConfiguration['width'] = MathUtility::forceIntegerInRange($processingConfiguration['width'], 1, 1000);
+            $processingConfiguration['height'] = MathUtility::forceIntegerInRange($processingConfiguration['height'], 1, 1000);
+        }
         $this->processingConfiguration = $processingConfiguration;
         if (is_array($databaseRow)) {
             $this->reconstituteFromDatabaseRecord($databaseRow);