[BUGFIX] Update checksums after file processing 08/17208/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 17 Dec 2012 21:17:01 +0000 (22:17 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 17 Dec 2012 21:20:09 +0000 (22:20 +0100)
When recreating an already processed file the LocalImageProcessor
updates the width, height and filesize of the new image but not
the checksum.

Because of that the file will be deleted in FileProcessingService
when $processedFile->isProcessed() is called. Since the checksum
is wrong this call assumes that the file needs to be recreated and
deletes the "old" file on the go.

This will lead to an exception in this request, when getPublicUrl is
called on this object.

Fixes: #44073
Releases: 6.1, 6.0

Change-Id: Ib2df87b54866262e0092fbb24b4222f0b298e9d6
Reviewed-on: https://review.typo3.org/17207
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-on: https://review.typo3.org/17208

typo3/sysext/core/Classes/Resource/Processing/LocalImageProcessor.php

index 025ead4..ce4b3cf 100644 (file)
@@ -83,7 +83,7 @@ class LocalImageProcessor implements ProcessorInterface {
 
                                $task->getTargetFile()->setName($task->getTargetFileName());
                                $task->getTargetFile()->updateProperties(
-                                       array('width' => $imageDimensions[0], 'height' => $imageDimensions[1], 'size' => filesize($result['filePath']))
+                                       array('width' => $imageDimensions[0], 'height' => $imageDimensions[1], 'size' => filesize($result['filePath']), 'checksum' => $task->getConfigurationChecksum())
                                );
                                $task->getTargetFile()->updateWithLocalFile($result['filePath']);
                        } else {