1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Support jpg images for avatars from users

This commit is contained in:
LEDfan 2014-06-16 15:28:25 +02:00
parent c655509c6d
commit 97d7fe40d6
2 changed files with 8 additions and 2 deletions

View File

@ -225,7 +225,7 @@ class LocalUsers extends AbstractBackend {
}
/**
* Help function to remove contacts from an addressbook.
* Help function to rsove contacts from an addressbook.
* This only happens when an admin remove an ownCloud user
* @param array $contacts array with userid of ownCloud users
* @param string $addressBookId

View File

@ -53,7 +53,13 @@ class User extends BaseTemporaryPhoto {
* depending on the type.
*/
protected function processImage() {
$localPath = \OCP\Config::getSystemValue('datadirectory') . '/' . $this->userId . '/avatar.png';
$localPath = \OCP\Config::getSystemValue('datadirectory') . '/' . $this->userId . '/avatar.';
if (file_exists($localPath . 'png')){
$localPath .= 'png';
} else if (file_exists($localPath . 'jpg')){
$localPath .= 'jpg';
}
$this->image = new \OCP\Image();
$this->image->loadFromFile($localPath);
}