cache resized avatars
This commit is contained in:
parent
d305412a35
commit
6b7e748245
|
@ -67,8 +67,13 @@ class Avatar implements \OCP\IAvatar {
|
|||
}
|
||||
|
||||
$avatar = new OC_Image();
|
||||
if ($this->view->file_exists('avatar.' . $size . '.' . $ext)) {
|
||||
$avatar->loadFromData($this->view->file_get_contents('avatar.' . $size . '.' . $ext));
|
||||
} else {
|
||||
$avatar->loadFromData($this->view->file_get_contents('avatar.' . $ext));
|
||||
$avatar->resize($size);
|
||||
$this->view->file_put_contents('avatar.' . $size . '.' . $ext, $avatar->data());
|
||||
}
|
||||
return $avatar;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue