X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile_photo.php;h=da45226fe02bbc20f983774eac313f21a5e5c946;hb=50ba02809425b9cc166909bc30100ec2c4e338e1;hp=7006349a6413791537e09e2170c44922ae150820;hpb=2ef81108b37a85642e1f3380044a03cb1cd8719a;p=friendica.git diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 7006349a64..da45226fe0 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -74,19 +74,19 @@ function profile_photo_post(App $a) $r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d AND `scale` = %d LIMIT 1", DBA::escape($image_id), DBA::escape(local_user()), intval($scale)); - $url = System::baseUrl() . '/profile/' . $a->user['nickname']; + $path = 'profile/' . $a->user['nickname']; if (DBA::isResult($r)) { $base_image = $r[0]; $Image = new Image($base_image['data'], $base_image['type']); if ($Image->isValid()) { - $Image->crop(175, $srcX, $srcY, $srcW, $srcH); + $Image->crop(300, $srcX, $srcY, $srcW, $srcH); $r = Photo::store($Image, local_user(), 0, $base_image['resource-id'], $base_image['filename'], L10n::t('Profile Photos'), 4, $is_default_profile); if ($r === false) { - notice(L10n::t('Image size reduction [%s] failed.', "175") . EOL); + notice(L10n::t('Image size reduction [%s] failed.', "300") . EOL); } $Image->scaleDown(80); @@ -125,8 +125,8 @@ function profile_photo_post(App $a) info(L10n::t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL); // Update global directory in background - if ($url && strlen(Config::get('system', 'directory'))) { - Worker::add(PRIORITY_LOW, "Directory", $url); + if ($path && strlen(Config::get('system', 'directory'))) { + Worker::add(PRIORITY_LOW, "Directory", $a->getBaseURL() . '/' . $path); } Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user()); @@ -135,7 +135,7 @@ function profile_photo_post(App $a) } } - $a->redirect($url); + $a->internalRedirect($path); return; // NOTREACHED } @@ -168,7 +168,7 @@ function profile_photo_post(App $a) @unlink($src); $imagecrop = profile_photo_crop_ui_head($a, $ph); - $a->redirect('profile_photo/use/' . $imagecrop['hash']); + $a->internalRedirect('profile_photo/use/' . $imagecrop['hash']); } function profile_photo_content(App $a) @@ -225,7 +225,7 @@ function profile_photo_content(App $a) Worker::add(PRIORITY_LOW, "Directory", $url); } - $a->redirect('profile/' . $a->user['nickname']); + $a->internalRedirect('profile/' . $a->user['nickname']); return; // NOTREACHED } $ph = new Image($r[0]['data'], $r[0]['type']); @@ -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(); }