From cb75c40f4e041b30c64de93530c63e841b4b1504 Mon Sep 17 00:00:00 2001 From: vinzv Date: Tue, 23 Oct 2018 16:36:57 +0200 Subject: [PATCH] adapted profile pic resize to 300px for whole system --- doc/api.md | 2 +- include/api.php | 6 +++--- mod/profile_photo.php | 2 +- src/Core/NotificationsManager.php | 4 ++-- src/Model/Contact.php | 2 +- src/Model/GContact.php | 2 +- src/Model/Photo.php | 4 ++-- src/Model/User.php | 2 +- src/Module/Proxy.php | 2 +- src/Network/Probe.php | 2 +- src/Protocol/DFRN.php | 2 +- src/Protocol/OStatus.php | 8 ++++---- src/Util/Network.php | 4 ++-- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/api.md b/doc/api.md index 07813b6a7..2715f4446 100644 --- a/doc/api.md +++ b/doc/api.md @@ -1061,7 +1061,7 @@ possibile scale value are: * 1: image with or height at <= 640 * 2: image with or height at <= 320 * 3: thumbnail 160x160 -* 4: Profile image at 175x175 +* 4: Profile image at 300x300 * 5: Profile image at 80x80 * 6: Profile image at 48x48 diff --git a/include/api.php b/include/api.php index 7e54fa382..86f2e3b2a 100644 --- a/include/api.php +++ b/include/api.php @@ -4556,11 +4556,11 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $ // upload profile image (scales 4, 5, 6) logger("photo upload: starting new profile image upload", LOGGER_DEBUG); - if ($width > 175 || $height > 175) { - $Image->scaleDown(175); + if ($width > 300 || $height > 300) { + $Image->scaleDown(300); $r = Photo::store($Image, local_user(), $visitor, $hash, $filename, $album, 4, $profile, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $desc); if (!$r) { - logger("photo upload: profile image upload with scale 4 (175x175) failed"); + logger("photo upload: profile image upload with scale 4 (300x300) failed"); } } diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 0d692a660..da45226fe 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -288,7 +288,7 @@ function profile_photo_crop_ui_head(App $a, Image $image) $height = $image->getHeight(); if ($width < 175 || $height < 175) { - $image->scaleUp(200); + $image->scaleUp(300); $width = $image->getWidth(); $height = $image->getHeight(); } diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index fb7760573..9250bc2e5 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -642,7 +642,7 @@ class NotificationsManager extends BaseObject 'madeby_zrl' => Contact::magicLink($it['url']), 'madeby_addr' => $it['addr'], 'contact_id' => $it['contact-id'], - 'photo' => ((x($it, 'fphoto')) ? ProxyUtils::proxifyUrl($it['fphoto'], false, ProxyUtils::SIZE_SMALL) : "images/person-175.jpg"), + 'photo' => ((x($it, 'fphoto')) ? ProxyUtils::proxifyUrl($it['fphoto'], false, ProxyUtils::SIZE_SMALL) : "images/person-300.jpg"), 'name' => $it['fname'], 'url' => $it['furl'], 'zrl' => Contact::magicLink($it['furl']), @@ -674,7 +674,7 @@ class NotificationsManager extends BaseObject 'uid' => $_SESSION['uid'], 'intro_id' => $it['intro_id'], 'contact_id' => $it['contact-id'], - 'photo' => ((x($it, 'photo')) ? ProxyUtils::proxifyUrl($it['photo'], false, ProxyUtils::SIZE_SMALL) : "images/person-175.jpg"), + 'photo' => ((x($it, 'photo')) ? ProxyUtils::proxifyUrl($it['photo'], false, ProxyUtils::SIZE_SMALL) : "images/person-300.jpg"), 'name' => $it['name'], 'location' => BBCode::convert($it['glocation'], false), 'about' => BBCode::convert($it['gabout'], false), diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 3524cd4ce..fdb49ac13 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -465,7 +465,7 @@ class Contact extends BaseObject $fields['micro'] = $prefix . '6' . $suffix; } else { // We hadn't found a photo entry, so we use the default avatar - $fields['photo'] = System::baseUrl() . '/images/person-175.jpg'; + $fields['photo'] = System::baseUrl() . '/images/person-300.jpg'; $fields['thumb'] = System::baseUrl() . '/images/person-80.jpg'; $fields['micro'] = System::baseUrl() . '/images/person-48.jpg'; } diff --git a/src/Model/GContact.php b/src/Model/GContact.php index 20e6f0751..cc7775377 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -995,7 +995,7 @@ class GContact "addr" => $user->nickname."@".$hostname, "nick" => $user->nickname, "network" => Protocol::OSTATUS, - "photo" => System::baseUrl()."/images/person-175.jpg"]; + "photo" => System::baseUrl()."/images/person-300.jpg"]; if (isset($user->bio)) { $contact["about"] = $user->bio; diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 6b094ded6..a9b4c0fb7 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -115,7 +115,7 @@ class Photo $type = Image::guessType($image_url, true); $Image = new Image($img_str, $type); if ($Image->isValid()) { - $Image->scaleToSquare(175); + $Image->scaleToSquare(300); $r = self::store($Image, $uid, $cid, $hash, $filename, 'Contact Photos', 4); @@ -172,7 +172,7 @@ class Photo } if ($photo_failure) { - $image_url = System::baseUrl() . '/images/person-175.jpg'; + $image_url = System::baseUrl() . '/images/person-300.jpg'; $thumb = System::baseUrl() . '/images/person-80.jpg'; $micro = System::baseUrl() . '/images/person-48.jpg'; } diff --git a/src/Model/User.php b/src/Model/User.php index 27ed28fd4..bdea5e28f 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -642,7 +642,7 @@ class User $Image = new Image($img_str, $type); if ($Image->isValid()) { - $Image->scaleToSquare(175); + $Image->scaleToSquare(300); $hash = Photo::newResource(); diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php index 8c3493b2a..29e0f4f52 100644 --- a/src/Module/Proxy.php +++ b/src/Module/Proxy.php @@ -103,7 +103,7 @@ class Proxy extends BaseModule $sizetype = ':thumb'; $url = substr($url, 0, -6); } elseif (substr($url, -6) == ':small') { - $size = 175; + $size = 300; $url = substr($url, 0, -6); $sizetype = ':small'; } elseif (substr($url, -7) == ':medium') { diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 08ec4ae1c..f892c3a5c 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -348,7 +348,7 @@ class Probe if (x($data, "photo")) { $data["baseurl"] = Network::getUrlMatch(normalise_link(defaults($data, "baseurl", "")), normalise_link($data["photo"])); } else { - $data["photo"] = System::baseUrl().'/images/person-175.jpg'; + $data["photo"] = System::baseUrl().'/images/person-300.jpg'; } if (empty($data["name"])) { diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index e8cf4a631..1dcc1197a 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -646,7 +646,7 @@ class DFRN XML::addElement($doc, $author, "dfrn:handle", $owner["addr"], $attributes); $attributes = ["rel" => "photo", "type" => "image/jpeg", - "media:width" => 175, "media:height" => 175, "href" => $owner['photo']]; + "media:width" => 300, "media:height" => 300, "href" => $owner['photo']]; if (!$public || !$hidewall) { $attributes["dfrn:updated"] = $picdate; diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 0e3d5e6c0..fb78d2ebb 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -1450,8 +1450,8 @@ class OStatus $attributes = [ "rel" => "avatar", "type" => "image/jpeg", // To-Do? - "media:width" => 175, - "media:height" => 175, + "media:width" => 300, + "media:height" => 300, "href" => $owner["photo"]]; XML::addElement($doc, $author, "link", "", $attributes); @@ -1769,8 +1769,8 @@ class OStatus $attributes = [ "rel" => "avatar", "type" => "image/jpeg", // To-Do? - "media:width" => 175, - "media:height" => 175, + "media:width" => 300, + "media:height" => 300, "href" => $contact["photo"]]; XML::addElement($doc, $object, "link", "", $attributes); diff --git a/src/Util/Network.php b/src/Util/Network.php index 1038fa3f0..3b27a0550 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -516,7 +516,7 @@ class Network public static function lookupAvatarByEmail($email) { - $avatar['size'] = 175; + $avatar['size'] = 300; $avatar['email'] = $email; $avatar['url'] = ''; $avatar['success'] = false; @@ -524,7 +524,7 @@ class Network Addon::callHooks('avatar_lookup', $avatar); if (! $avatar['success']) { - $avatar['url'] = System::baseUrl() . '/images/person-175.jpg'; + $avatar['url'] = System::baseUrl() . '/images/person-300.jpg'; } logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], LOGGER_DEBUG);