aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photo.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-08-17 17:35:37 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-08-17 17:35:37 +0200
commitbdf42473a0341f291cd256323d122aa80bb0cb0b (patch)
tree922a5ba24a34d7ea89673019e82f68436edb7091 /mod/photo.php
parent6c423feed2d8bc5bd36d2a1cbac073915e523749 (diff)
parentdb03b1ab173d61b1ee75271dac1e48f3475ad42c (diff)
downloadvolse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.tar.gz
volse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.tar.bz2
volse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.zip
Merge remote-tracking branch 'friendika/master' into newui
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
+}