]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed bugs in avatar cropping with remembering old crop coordinates and resizing...
authorCash Costello <cash.costello@gmail.com>
Wed, 16 Nov 2011 01:30:59 +0000 (20:30 -0500)
committerCash Costello <cash.costello@gmail.com>
Wed, 16 Nov 2011 01:30:59 +0000 (20:30 -0500)
actions/avatar/crop.php
actions/avatar/upload.php

index 39061fa2cd5d701aa6a88600d3546a84c23fffd0..6d71b6f064ebc9da1d5b51866e051edb9432016a 100644 (file)
@@ -23,6 +23,7 @@ $filehandler->setFilename("profile/" . $owner->guid . "master" . ".jpg");
 $filename = $filehandler->getFilenameOnFilestore();
 
 $icon_sizes = elgg_get_config('icon_sizes');
+unset($icon_sizes['master']);
 
 // get the images and save their file handlers into an array
 // so we can do clean up if one fails.
index 2e8ff98b3cedcde4c31bf152554609938e7caf92..0752615e055af1663159b0cf4f7419ba33512e4d 100644 (file)
@@ -44,6 +44,12 @@ foreach ($icon_sizes as $name => $size_info) {
        }
 }
 
+// reset crop coordinates
+$owner->x1 = 0;
+$owner->x2 = 0;
+$owner->y1 = 0;
+$owner->y2 = 0;
+
 $owner->icontime = time();
 if (elgg_trigger_event('profileiconupdate', $owner->type, $owner)) {
        system_message(elgg_echo("avatar:upload:success"));