summaryrefslogtreecommitdiffstats
path: root/lib/private/Avatar
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-06-02 00:37:36 +0000
committerChristopher Ng <chrng8@gmail.com>2022-06-02 00:37:36 +0000
commit57c66bf7cb772d5d6d7a17f10cd90adf48884b2d (patch)
tree1043929d764925819b9e4befe499a9ea3607ae7e /lib/private/Avatar
parent4e5ed32025398e006f40e819428270d209994e03 (diff)
downloadnextcloud-server-57c66bf7cb772d5d6d7a17f10cd90adf48884b2d.tar.gz
nextcloud-server-57c66bf7cb772d5d6d7a17f10cd90adf48884b2d.zip
Use Image class from public API
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'lib/private/Avatar')
-rw-r--r--lib/private/Avatar/Avatar.php5
-rw-r--r--lib/private/Avatar/UserAvatar.php5
2 files changed, 4 insertions, 6 deletions
diff --git a/lib/private/Avatar/Avatar.php b/lib/private/Avatar/Avatar.php
index 3bd58bb7681..f0e14ad8b2f 100644
--- a/lib/private/Avatar/Avatar.php
+++ b/lib/private/Avatar/Avatar.php
@@ -38,7 +38,6 @@ namespace OC\Avatar;
use Imagick;
use OC\Color;
-use OC_Image;
use OCP\Files\NotFoundException;
use OCP\IAvatar;
use Psr\Log\LoggerInterface;
@@ -106,7 +105,7 @@ abstract class Avatar implements IAvatar {
return false;
}
- $avatar = new OC_Image();
+ $avatar = new \OCP\Image();
$avatar->loadFromData($file->getContent());
return $avatar;
}
@@ -148,7 +147,7 @@ abstract class Avatar implements IAvatar {
$avatar->setFont($font);
$avatar->readImageBlob($svg);
$avatar->setImageFormat('png');
- $image = new OC_Image();
+ $image = new \OCP\Image();
$image->loadFromData((string)$avatar);
$data = $image->data();
return $data === null ? false : $data;
diff --git a/lib/private/Avatar/UserAvatar.php b/lib/private/Avatar/UserAvatar.php
index b46e4816fa2..6cca5a1c355 100644
--- a/lib/private/Avatar/UserAvatar.php
+++ b/lib/private/Avatar/UserAvatar.php
@@ -31,7 +31,6 @@ namespace OC\Avatar;
use OC\NotSquareException;
use OC\User\User;
-use OC_Image;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OCP\Files\SimpleFS\ISimpleFile;
@@ -130,7 +129,7 @@ class UserAvatar extends Avatar {
return $data;
}
- $img = new OC_Image();
+ $img = new \OCP\Image();
if (
(is_resource($data) && get_resource_type($data) === 'gd') ||
(is_object($data) && get_class($data) === \GdImage::class)
@@ -279,7 +278,7 @@ class UserAvatar extends Avatar {
$data = $this->generateAvatar($this->getDisplayName(), $size);
}
} else {
- $avatar = new OC_Image();
+ $avatar = new \OCP\Image();
$file = $this->folder->getFile('avatar.' . $ext);
$avatar->loadFromData($file->getContent());
$avatar->resize($size);