From: Matthias Schmidt Date: Tue, 21 Apr 2015 17:08:02 +0000 (+0200) Subject: Add missing filesize update after image rotation X-Git-Tag: 2.1.4~62 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f2daaaea1d0469e671ec9583320ccdf76b077d4;p=GitHub%2FWoltLab%2FWCF.git Add missing filesize update after image rotation --- diff --git a/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php b/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php index 863c29d7d5..7e0c53160e 100644 --- a/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php @@ -206,18 +206,21 @@ class AttachmentAction extends AbstractDatabaseObjectAction { if ($newImage !== null) { $adapter->load($newImage, $adapter->getType()); - - // update width and height of the attachment + } + + $adapter->writeImage($attachment->getLocation()); + + if ($newImage !== null) { + // update width, height and filesize of the attachment if ($orientation == ExifUtil::ORIENTATION_90_ROTATE || $orientation == ExifUtil::ORIENTATION_270_ROTATE) { $attachmentEditor = new AttachmentEditor($attachment); $attachmentEditor->update(array( 'height' => $attachment->width, - 'width' => $attachment->height + 'width' => $attachment->height, + 'filesize' => filesize($attachment->getLocation()) )); } } - - $adapter->writeImage($attachment->getLocation()); } } }