]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix problems when crop controls not touched
authorMeitar Moscovitz <meitarm@gmail.com>
Thu, 29 Jan 2009 19:56:22 +0000 (14:56 -0500)
committerEvan Prodromou <git@evanprodromou.name>
Thu, 29 Jan 2009 19:56:22 +0000 (14:56 -0500)
actions/grouplogo.php

index 11489691eb3a788608011c65d9450f348250e422..ba9cdfe2ab2aab1404f1915a61d728c3d6f4c2fe 100644 (file)
@@ -380,11 +380,6 @@ class GrouplogoAction extends Action
 
         $profile = $user->getProfile();
 
-        $x = $this->arg('avatar_crop_x');
-        $y = $this->arg('avatar_crop_y');
-        $w = $this->arg('avatar_crop_w');
-        $h = $this->arg('avatar_crop_h');
-
         $filedata = $_SESSION['FILEDATA'];
 
         if (!$filedata) {
@@ -392,6 +387,11 @@ class GrouplogoAction extends Action
             return;
         }
 
+        $x = $this->arg('avatar_crop_x');
+        $y = $this->arg('avatar_crop_y');
+        $w = ($this->arg('avatar_crop_w')) ? $this->arg('avatar_crop_w') : $filedata['width'];
+        $h = ($this->arg('avatar_crop_h')) ? $this->arg('avatar_crop_h') : $filedata['height'];
+
         $filepath = common_avatar_path($filedata['filename']);
 
         if (!file_exists($filepath)) {