summaryrefslogtreecommitdiff
path: root/classes/Avatar.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2008-12-11 23:30:18 -0500
committerZach Copley <zach@controlyourself.ca>2008-12-11 23:30:18 -0500
commit6b51941056a361327e8717ede1194df3abe430a9 (patch)
tree19f77b69ad1e6576710b3290c0a66172717c5121 /classes/Avatar.php
parentba24378fdff1de0aee31878dca0e92cc87a56ae8 (diff)
Actually crop your avatar when hitting 'crop' button on profile
darcs-hash:20081212043018-7b5ce-bc83b66e19007aa0a04fbb40053217ef92c44779.gz
Diffstat (limited to 'classes/Avatar.php')
-rw-r--r--classes/Avatar.php34
1 files changed, 16 insertions, 18 deletions
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 3c754ec2d..4fdb99d35 100644
--- a/classes/Avatar.php
+++ b/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);
+ }
}