Fixed import issue
authorMarcel Werk <burntime@woltlab.com>
Wed, 31 Jul 2013 11:52:18 +0000 (13:52 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 31 Jul 2013 11:52:18 +0000 (13:52 +0200)
wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php

index 5334d54aeebf791a9738ea863ab22a0daf988ccc..95512042b68eeeec0201e8c7b57c6f98da12ce2d 100644 (file)
@@ -32,6 +32,15 @@ class AbstractAttachmentImporter implements IImporter {
                // get file hash
                if (empty($data['fileHash'])) $data['fileHash'] = sha1_file($additionalData['fileLocation']);
                
+               // get image size
+               if (!empty($data['isImage'])) {
+                       $imageData = @getimagesize($additionalData['fileLocation']);
+                       if ($imageData !== false) {
+                               $data['width'] = $imageData[0];
+                               $data['height'] = $imageData[1];
+                       }
+               }
+               
                // get user id
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);