Open blacksenator opened 5 years ago
There is a complication with the vcard specification in that it has conflicting information about this:
https://www.rfc-editor.org/errata/eid3845
Unfortunately this is therefore a little bit open to interpretation. I don't think the serialization that is used is necessarily wrong. It's simply impossible to do this right :(
According to your answer: What is the correct function parameter three for creating a Version 4.0 PHOTO property?
$vcard->add('PHOTO', $base64data, [ARRAY]);
I tried ['VALUE' => 'URI:data:image/jpeg;base64\']
but received:
Unsupported VALUE parameter for PHOTO property. You supplied "URI:data:image/jpeg;base64\"
I have not tried the keys TYPE
and encoding
- because this is obviously incorrect for version 4.0!
+++UPDATE+++ I found only this solution - looks not very smart:
$vcard->add('PHOTO', 'data:' . $mimetype . ';base64,' . base64_encode([$base64_data]));
Note: This seems to be a duplicate of #382.
RFC2426 shows the following example for 3.0:
For my project I´m actually handle only JPEGs in Version 3.0 vCards and adding this property in this way:
which works perfectly. After converting (for test purposes) this property shows:
which does not correspond to the RFC RFC6350: