]> source.dussan.org Git - nextcloud-server.git/commitdiff
use right format for avatars
authorBjoern Schiessle <bjoern@schiessle.org>
Mon, 13 Mar 2017 15:54:27 +0000 (16:54 +0100)
committerBjoern Schiessle <bjoern@schiessle.org>
Fri, 24 Mar 2017 10:06:44 +0000 (11:06 +0100)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/dav/lib/CardDAV/Converter.php
apps/dav/tests/unit/CardDAV/ConverterTest.php

index eb43fe7d671596ace3e3b6908e5999af7b605ffd..9e106a0fe28cfb249e8b904b37589c74c59db7ef 100644 (file)
@@ -78,7 +78,7 @@ class Converter {
                                                break;
                                        case AccountManager::PROPERTY_AVATAR:
                                                if ($image !== null) {
-                                                       $vCard->add('PHOTO', 'data:'.$image->mimeType().';base64,' . base64_encode($image->data()));
+                                                       $vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]);
                                                }
                                                break;
                                        case AccountManager::PROPERTY_EMAIL:
index ff218bfc78c048e7b2a8bfde18b74a29d45005d8..448d80f3070e12f15c24cf1f0dc3aedb1604e82c 100644 (file)
@@ -146,7 +146,7 @@ class ConverterTest extends  TestCase {
                                [
                                        'cloud' => 'foo@cloud.net',
                                        'email' => 'foo@bar.net',
-                                       'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5',
+                                       'photo' => 'MTIzNDU2Nzg5',
                                ],
                                null,
                                'foo@bar.net',
@@ -157,7 +157,7 @@ class ConverterTest extends  TestCase {
                                        'cloud' => 'foo@cloud.net',
                                        'email' => 'foo@bar.net',
                                        'fn' => 'Dr. Foo Bar',
-                                       'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5',
+                                       'photo' => 'MTIzNDU2Nzg5',
                                ],
                                "Dr. Foo Bar",
                                "foo@bar.net",
@@ -167,7 +167,7 @@ class ConverterTest extends  TestCase {
                                [
                                        'cloud' => 'foo@cloud.net',
                                        'fn' => 'Dr. Foo Bar',
-                                       'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5',
+                                       'photo' => 'MTIzNDU2Nzg5',
                                ],
                                "Dr. Foo Bar",
                                null,
@@ -177,7 +177,7 @@ class ConverterTest extends  TestCase {
                                [
                                        'cloud' => 'foo@cloud.net',
                                        'fn' => 'Dr. Foo Bar',
-                                       'photo' => 'data:image/jpeg;base64,MTIzNDU2Nzg5',
+                                       'photo' => 'MTIzNDU2Nzg5',
                                ],
                                'Dr. Foo Bar',
                                '',