aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photo.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-03 21:05:39 -0700
committerFriendika <info@friendika.com>2011-08-03 21:05:39 -0700
commitd45a66e700a62626007b05ef1b78dff8f0931210 (patch)
tree38e2d19a744e65b44184885400c0ba33984bec7a /mod/photo.php
parentad1e827169d9f57c02746b51c5268bdbe2cd8ac9 (diff)
downloadvolse-hubzilla-d45a66e700a62626007b05ef1b78dff8f0931210.tar.gz
volse-hubzilla-d45a66e700a62626007b05ef1b78dff8f0931210.tar.bz2
volse-hubzilla-d45a66e700a62626007b05ef1b78dff8f0931210.zip
allow custom avatar sizes - needed for Diaspora hcard/vcard
Diffstat (limited to 'mod/photo.php')
-rw-r--r--mod/photo.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/mod/photo.php b/mod/photo.php
index 9809aa418..3994620f8 100644
--- a/mod/photo.php
+++ b/mod/photo.php
@@ -5,6 +5,11 @@ require_once('include/security.php');
function photo_init(&$a) {
switch($a->argc) {
+ case 4:
+ $person = $a->argv[3];
+ $customres = intval($a->argv[2]);
+ $type = $a->argv[1];
+ break;
case 3:
$person = $a->argv[2];
$type = $a->argv[1];
@@ -29,6 +34,7 @@ function photo_init(&$a) {
switch($type) {
case 'profile':
+ case 'custom':
$resolution = 4;
break;
case 'micro':
@@ -113,8 +119,17 @@ function photo_init(&$a) {
// NOTREACHED
}
+ if(intval($customres) && $customres > 0 && $customres < 500) {
+ require_once('include/Photo.php');
+ $ph = new Photo($data);
+ if($ph->is_valid()) {
+ $ph->scaleImageSquare($customres);
+ $data = $ph->imageString();
+ }
+ }
+
header("Content-type: image/jpeg");
echo $data;
killme();
// NOTREACHED
-} \ No newline at end of file
+}