summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-17 11:46:30 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-18 13:40:55 +0100
commit3d4c698f448925aca62976175ffd4bab9694c7d6 (patch)
tree6ab0f4840ef17e67cc97426cc323b46dc31f80c0 /core/Controller
parentc121610d5a42b8a30a328c0a2f9704fb20d4c369 (diff)
downloadnextcloud-server-3d4c698f448925aca62976175ffd4bab9694c7d6.tar.gz
nextcloud-server-3d4c698f448925aca62976175ffd4bab9694c7d6.zip
Improve OC_Image code to not guess the type of input, but actually request the specific methods to be called
Followup to #7836 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/Controller')
-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);