Fixed issue in thumbnail generation
authorMarcel Werk <burntime@woltlab.com>
Tue, 13 May 2014 16:29:27 +0000 (18:29 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 13 May 2014 16:29:27 +0000 (18:29 +0200)
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php

index fac396da48ef2dde7bce94fc28070f2c4c6cca31..6a2bae9e1a415aaec43d830d4c5ddab7a6c89b26 100644 (file)
@@ -270,6 +270,21 @@ class AttachmentAction extends AbstractDatabaseObjectAction {
                        
                        $adapter->loadFile($attachment->getLocation());
                        $updateData = array();
+                       // remove / reset old thumbnails
+                       if ($attachment->tinyThumbnailType) {
+                               @unlink($attachment->getTinyThumbnailLocation());
+                               $updateData['tinyThumbnailType'] = '';
+                               $updateData['tinyThumbnailSize'] = 0;
+                               $updateData['tinyThumbnailWidth'] = 0;
+                               $updateData['tinyThumbnailHeight'] = 0;
+                       }
+                       if ($attachment->thumbnailType) {
+                               @unlink($attachment->getThumbnailLocation());
+                               $updateData['thumbnailType'] = '';
+                               $updateData['thumbnailSize'] = 0;
+                               $updateData['thumbnailWidth'] = 0;
+                               $updateData['thumbnailHeight'] = 0;
+                       }
                        
                        // create tiny thumbnail
                        $tinyThumbnailLocation = $attachment->getTinyThumbnailLocation();