]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile_photo.php
Merge pull request #5830 from nupplaphil/update_from_boot
[friendica.git] / mod / profile_photo.php
index 5fdff41e8c6b6d54820f5a45bac9279197032c69..da45226fe02bbc20f983774eac313f21a5e5c946 100644 (file)
@@ -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)
                        }
                }
 
-               goaway($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);
-       goaway(System::baseUrl() . '/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);
                        }
 
-                       goaway(System::baseUrl() . '/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();
        }