Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use \OCP\Image instead of \OC_Image #13207

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Controller/TempAvatarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function postAvatar(): DataResponse {
}

try {
$image = new \OC_Image();
$image = new \OCP\Image();
$image->loadFromData($content);
$image->readExif($content);
$image->fixOrientation();
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/AvatarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function setAvatarFromRequest(Room $room, ?array $file): void {

$content = file_get_contents($file['tmp_name']);
unlink($file['tmp_name']);
$image = new \OC_Image();
$image = new \OCP\Image();
$image->loadFromData($content);
$image->readExif($content);
$this->setAvatar($room, $image);
Expand Down Expand Up @@ -98,7 +98,7 @@ public function setAvatarFromEmoji(Room $room, string $emoji, ?string $color): v
$this->roomService->setAvatar($room, $avatarName);
}

public function setAvatar(Room $room, \OC_Image $image): void {
public function setAvatar(Room $room, \OCP\Image $image): void {
if ($room->getType() === Room::TYPE_ONE_TO_ONE || $room->getType() === Room::TYPE_ONE_TO_ONE_FORMER) {
throw new InvalidArgumentException($this->l->t('One-to-one rooms always need to show the other users avatar'));
}
Expand Down
4 changes: 3 additions & 1 deletion tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
</UndefinedClass>
</file>
<file src="lib/Service/AvatarService.php">
<MissingDependency>
<code><![CDATA[\OCP\Image]]></code>
</MissingDependency>
<UndefinedClass>
<code><![CDATA[Filesystem]]></code>
<code><![CDATA[\OC_Image]]></code>
</UndefinedClass>
</file>
<file src="lib/Service/RecordingService.php">
Expand Down
Loading