Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-01-18 16:39:08 +0300
committerGitHub <noreply@github.com>2018-01-18 16:39:08 +0300
commitf0b7b2dedf75ef3e483de584094586fbadc4455a (patch)
tree0650346678c3e291b682cd23fb0f857fd0205987 /core
parentd0c46ab45e48454bd76cbe6b61cc604074c57a76 (diff)
parent3d4c698f448925aca62976175ffd4bab9694c7d6 (diff)
Merge pull request #7911 from nextcloud/improve-oc_image
Improve OC_Image code to not guess the type of input
Diffstat (limited to 'core')
-rw-r--r--core/Controller/AvatarController.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index c01e81a1790..0d0a0274414 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -285,7 +285,8 @@ class AvatarController extends Controller {
Http::STATUS_NOT_FOUND);
}
- $image = new \OC_Image($tmpAvatar);
+ $image = new \OC_Image();
+ $image->loadFromData($tmpAvatar);
$resp = new DataDisplayResponse($image->data(),
Http::STATUS_OK,
@@ -322,7 +323,8 @@ class AvatarController extends Controller {
Http::STATUS_BAD_REQUEST);
}
- $image = new \OC_Image($tmpAvatar);
+ $image = new \OC_Image();
+ $image->loadFromData($tmpAvatar);
$image->crop($crop['x'], $crop['y'], (int)round($crop['w']), (int)round($crop['h']));
try {
$avatar = $this->avatarManager->getAvatar($this->userId);