From 7eab6805b6cf3528066f772e501c9daff22cf191 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 15 Nov 2011 20:30:59 -0500 Subject: fixed bugs in avatar cropping with remembering old crop coordinates and resizing the master --- actions/avatar/crop.php | 1 + actions/avatar/upload.php | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'actions/avatar') diff --git a/actions/avatar/crop.php b/actions/avatar/crop.php index 39061fa2c..6d71b6f06 100644 --- a/actions/avatar/crop.php +++ b/actions/avatar/crop.php @@ -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. diff --git a/actions/avatar/upload.php b/actions/avatar/upload.php index 2e8ff98b3..0752615e0 100644 --- a/actions/avatar/upload.php +++ b/actions/avatar/upload.php @@ -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")); -- cgit v1.2.3