When adding images to the contact resource in akonadi (via KAddressBook) the Photo Format Type in the PHOTO tag is set incorrectly. It uses a mime type representation ("image/jpeg" or "image/png"). For example: PHOTO;ENCODING=b;TYPE=image/jpeg:/9j/4AAQSkZJR... This is wrong for vCard 2.1 and 3.0. It says in the vCard 3.0 spec: 'The TYPE parameter values MUST be one of the IANA registered image formats or a non-standard image format.' (see here: vCard 2.1: http://www.imc.org/pdi/vcard-21.doc, page 10; 3.0: http://www.rfc-editor.org/rfc/rfc2426.txt, page 9). Correct would be: PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJR... The problem seems to be in VCardTool::createPicture(...) (vcardtool.cpp:854) but I'm not sure if fixing it here is enough. Reproducible: Always Steps to Reproduce: 1. Open KAddressBook and add a photo to a contact 2. Open Aconadi Console, switch to browser and select your contact resource 3. Select the relevant vcf file and see it's 'Raw Payload' Actual Results: The raw payload shows: PHOTO;ENCODING=b;TYPE=image/jpeg:/9j/4AAQSkZJR... Expected Results: While it should actually be: PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJR... The issue prevents for example proper syncing with syncevolution.
Git commit f7de08b9f65e2c7414f237dda9e024ebcdbccd31 by Montel Laurent. Committed on 16/10/2012 at 12:34. Pushed by mlaurent into branch 'KDE/4.9'. Fix Bug 308480 - vCards get imported/exported with incorrect Photo Format Type FIXED-IN: 4.9.3 M +2 -2 kabc/vcardtool.cpp http://commits.kde.org/kdepimlibs/f7de08b9f65e2c7414f237dda9e024ebcdbccd31
I tested and works fine now. Regards
That was quick. Thanks! Had a look into the vCard 4.0 spec: http://www.rfc-editor.org/rfc/rfc6350.txt (p. 29) They changed the tags here and also switched to mime types. Maybe something to consider later when adding 4.0 support. Example: PHOTO:data:image/jpeg;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhv AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0 <...remainder of base64-encoded data...>
For the moment we don't have support for vcard4.0 Don't know if a program has this support. Thunderbird still uses vcard 2.1
(In reply to comment #0) > When adding images to the contact resource in akonadi (via KAddressBook) the > Photo Format Type in the PHOTO tag is set incorrectly. It uses a mime type > representation ("image/jpeg" or "image/png"). > For example: PHOTO;ENCODING=b;TYPE=image/jpeg:/9j/4AAQSkZJR... > Correct would be: PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJR... Dang, I had misread the rfc there. That is perhaps the reason for the the bug reports where I blamed the SoGo connector in connection with ownCloud. KDEPIM/Android/N900/N9(50) reads the profile pictures just fine with the full mimetype, so I automatically blamed Evolution/Thunderbird/Sogo :-P