From 6b51941056a361327e8717ede1194df3abe430a9 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 11 Dec 2008 23:30:18 -0500 Subject: Actually crop your avatar when hitting 'crop' button on profile darcs-hash:20081212043018-7b5ce-bc83b66e19007aa0a04fbb40053217ef92c44779.gz --- _darcs/pristine/classes/Avatar.php | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to '_darcs/pristine/classes/Avatar.php') diff --git a/_darcs/pristine/classes/Avatar.php b/_darcs/pristine/classes/Avatar.php index 3c754ec2d..4fdb99d35 100644 --- a/_darcs/pristine/classes/Avatar.php +++ b/_darcs/pristine/classes/Avatar.php @@ -79,22 +79,20 @@ class Avatar extends Memcached_DataObject } } - function to_image() - { - $filepath = common_avatar_path($this->filename); - if ($this->mediatype == 'image/gif') { - return imagecreatefromgif($filepath); - } else if ($this->mediatype == 'image/jpeg') { - return imagecreatefromjpeg($filepath); - } else if ($this->mediatype == 'image/png') { - return imagecreatefrompng($filepath); - } else { - return null; - } - } - - function &pkeyGet($kv) - { - return Memcached_DataObject::pkeyGet('Avatar', $kv); - } + function to_image() { + $filepath = common_avatar_path($this->filename); + if ($this->mediatype == 'image/gif') { + return imagecreatefromgif($filepath); + } else if ($this->mediatype == 'image/jpeg') { + return imagecreatefromjpeg($filepath); + } else if ($this->mediatype == 'image/png') { + return imagecreatefrompng($filepath); + } else { + return NULL; + } + } + + function &pkeyGet($kv) { + return Memcached_DataObject::pkeyGet('Avatar', $kv); + } } -- cgit v1.2.3-54-g00ecf