mangstadt / ez-vcard

A vCard parser library for Java
Other
398 stars 92 forks source link

unable to get Photo when using URL #109

Closed rajp6265 closed 1 year ago

rajp6265 commented 3 years ago

Hello,

I am not able to see photos when using the URL of an image. attaching generated vcf data along with it. can anyone help regarding this?

BEGIN:VCARD VERSION:3.0 PRODID:ez-vcard 0.11.0 N:;Ars FN:Ars
TITLE: ORG: ADR;TYPE=home:;;;;;9 LABEL;TYPE=home:\, \, TEL;TYPE=work:9 URL: PHOTO;TYPE=jpeg;VALUE=https://png.pngtree.com/png-clipart/20190516/original/pngtree-infinity-initial-letter-dd-letter-d-logo-design-linked-png-image_3749553.jpg END:VCARD

mangstadt commented 3 years ago

The PHOTO property is incorrectly formatted. It should be:

PHOTO;TYPE=jpeg;VALUE=uri:https://png.pngtree.com/png-clipart/20190516/original/pngtree-infinity-initial-letter-dd-letter-d-logo-design-linked-png-image_3749553.jpg
rajp6265 commented 3 years ago

Hi, I have generated below vcf data from the library itself, still not getting the contact image.

Java Code For adding Photo: Photo photo = new Photo(payload.getProfilePhoto(), ImageType.JPEG); vcard.addPhoto(photo);

BEGIN:VCARD VERSION:3.0 PRODID:ez-vcard 0.11.0 N:;Ars PHOTO;TYPE=jpeg;VALUE=uri:https://png.pngtree.com/png-clipart/20190516/orig inal/pngtree-infinity-initial-letter-dd-letter-d-logo-design-linked-png-im age_3749553.jpg END:VCARD

I have tried after removing white space which is at the starting of a new line of image URL, but it does not work.

mangstadt commented 3 years ago

I have tried after removing white space which is at the starting of a new line of image URL, but it does not work.

Do not remove that whitespace. It indicates that the line is folded.

rajp6265 commented 3 years ago

Hi, With library-generated VCF data, the image could not be seen after importing vcf file. is that anything wrong with the generated data?

mangstadt commented 3 years ago

Does the photo URL return an image file or does it open a web page? If it opens a web page, then that is probably why you are having trouble.

Assuming the URL is correct, I don't see anything wrong with the vCard you emailed me! :(

rajp6265 commented 3 years ago

Yeah, I am digging into it and will let you know if I find any resolution. Thank you for your time :)

Maxim-Mazurok commented 3 years ago

The images might be too big. I'm using 320x320 base64-encoded JPEG, which is 10.74 KB in size

skypesky commented 1 month ago

I have tried after removing white space which is at the starting of a new line of image URL, but it does not work.

Do not remove that whitespace. It indicates that the line is folded.

related: https://www.rfc-editor.org/rfc/rfc6350.html#section-3.2