From: Marcel Werk Date: Tue, 13 May 2014 16:29:27 +0000 (+0200) Subject: Fixed issue in thumbnail generation X-Git-Tag: 2.0.7~37 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=82123f7169757ddd08ce478f9c313ae761e9f59c;p=GitHub%2FWoltLab%2FWCF.git Fixed issue in thumbnail generation --- 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();