From 82123f7169757ddd08ce478f9c313ae761e9f59c Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 13 May 2014 18:29:27 +0200 Subject: [PATCH] Fixed issue in thumbnail generation --- .../data/attachment/AttachmentAction.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php b/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php index fac396da48..6a2bae9e1a 100644 --- a/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php @@ -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(); -- 2.20.1