mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-17 04:15:15 +02:00
allow custom avatar sizes - needed for Diaspora hcard/vcard
This commit is contained in:
parent
ad1e827169
commit
d45a66e700
4 changed files with 43 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue