[BUGFIX] Only persist processedFile if processing was successful
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Processing / LocalImageProcessor.php
index 9a5c980..537f79b 100644 (file)
@@ -63,7 +63,7 @@ class LocalImageProcessor implements ProcessorInterface {
                        if ($result === NULL) {
                                $task->setExecuted(TRUE);
                                $task->getTargetFile()->setUsesOriginalFile();
-                       } elseif (file_exists($result['filePath'])) {
+                       } elseif (!empty($result['filePath']) && file_exists($result['filePath'])) {
                                $task->setExecuted(TRUE);
                                $imageDimensions = $this->getGraphicalFunctionsObject()->getImageDimensions($result['filePath']);
                                $task->getTargetFile()->setName($task->getTargetFileName());
@@ -73,7 +73,7 @@ class LocalImageProcessor implements ProcessorInterface {
                                $task->getTargetFile()->updateWithLocalFile($result['filePath']);
 
                        // New dimensions + no new file (for instance svg)
-                       } elseif (!empty($result['width']) && !empty($result['height'])) {
+                       } elseif (!empty($result['width']) && !empty($result['height']) && empty($result['filePath'])) {
                                $task->setExecuted(TRUE);
                                $task->getTargetFile()->setUsesOriginalFile();
                                $task->getTargetFile()->updateProperties(