[BUGFIX] Fixed processing of non jpg, png and gif images 51/51751/4
authorFrans Saris <franssaris@gmail.com>
Sun, 19 Feb 2017 10:11:05 +0000 (11:11 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Sun, 12 Mar 2017 10:30:06 +0000 (11:30 +0100)
Resolves: #79903
Releases: master
Change-Id: I159286a17bbb7dbab9d5ef696608e0e4d8558e7d
Reviewed-on: https://review.typo3.org/51751
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anders Kostending <aha@systime.dk>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/core/Classes/Resource/Processing/AbstractGraphicalTask.php
typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php

index f9f7f8b..2055301 100644 (file)
@@ -14,8 +14,6 @@ namespace TYPO3\CMS\Core\Resource\Processing;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Resource\AbstractFile;
-
 /**
  * Abstract base implementation of a task.
  *
@@ -69,9 +67,9 @@ abstract class AbstractGraphicalTask extends AbstractTask
     {
         if (!empty($this->configuration['fileExtension'])) {
             $targetFileExtension = $this->configuration['fileExtension'];
-        } elseif ($this->getSourceFile()->getType() === AbstractFile::FILETYPE_IMAGE) {
+        } elseif (in_array($this->getSourceFile()->getExtension(), ['jpg', 'jpeg', 'png', 'gif'], true)) {
             $targetFileExtension = $this->getSourceFile()->getExtension();
-        // If true, thumbnails from non-image files will be converted to 'png', otherwise 'gif'
+        // If true, thumbnails from non-processable files will be converted to 'png', otherwise 'gif'
         } elseif ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails_png']) {
             $targetFileExtension = 'png';
         } else {
index 9a4fc95..a26cd0f 100644 (file)
@@ -95,7 +95,7 @@ class LocalCropScaleMaskHelper
             // the result info is an array with 0=width,1=height,2=extension,3=filename
             $result = $gifBuilder->imageMagickConvert(
                 $originalFileName,
-                '',
+                $configuration['fileExtension'],
                 '',
                 '',
                 sprintf('-crop %dx%d+%d+%d', $newWidth, $newHeight, $offsetLeft, $offsetTop),