1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

When loading the image from the VCard we get the raw binary data - no need to base64 encode anything anymore

This commit is contained in:
Thomas Müller 2015-06-30 13:04:27 +02:00
parent bafbbe2bd5
commit 19b1fa25aa
4 changed files with 12 additions and 13 deletions

View File

@ -407,9 +407,9 @@ class Contact extends VObject\VCard implements IPIMObject {
public function getPhoto() {
$image = new \OCP\Image();
if (isset($this->PHOTO) && $image->loadFromBase64((string)$this->PHOTO)) {
if (isset($this->PHOTO) && $image->loadFromData($this->PHOTO->getValue())) {
return $image;
} elseif (isset($this->LOGO) && $image->loadFromBase64((string)$this->LOGO)) {
} elseif (isset($this->LOGO) && $image->loadFromData($this->LOGO->getValue())) {
return $image;
}

View File

@ -181,7 +181,6 @@ class ImportController extends Controller {
return $response;
}
$view = \OCP\Files::getStorage('contacts');
$file = $view->file_get_contents('/imports/' . $filename);
$importManager = new ImportManager();

View File

@ -34,7 +34,7 @@ class Contact extends BaseTemporaryPhoto {
/**
* The Contact object to load the image from
*
* @var OCA\Contacts\Contact
* @var \OCA\Contacts\Contact
*/
protected $contact;

View File

@ -39,14 +39,14 @@ use Sabre\VObject;
* @property \OC\VObject\CompoundProperty ORG
* @property \OC\VObject\CompoundProperty ADR
* @property \OCA\Contacts\VObject\GroupProperty CATEGORIES
* @property \OC\VObject\StringProperty FN
* @property \OC\VObject\StringProperty EMAIL
* @property \OC\VObject\StringProperty VERSION
* @property \OC\VObject\StringProperty BDAY
* @property \OC\VObject\StringProperty UID
* @property \OC\VObject\StringProperty REV
* @property \OC\VObject\StringProperty PHOTO
* @property \OC\VObject\StringProperty LOGO
* @property \Sabre\VObject\Property\Text FN
* @property \Sabre\VObject\Property\Text EMAIL
* @property \Sabre\VObject\Property\Text VERSION
* @property \Sabre\VObject\Property\Text BDAY
* @property \Sabre\VObject\Property\Text UID
* @property \Sabre\VObject\Property\Text REV
* @property \Sabre\VObject\Property\Binary PHOTO
* @property \Sabre\VObject\Property\Binary LOGO
*/
class VCard extends VObject\Component\VCard {