QR-Pop icon indicating copy to clipboard operation
QR-Pop copied to clipboard

Support for contact photos using vCard PHOTO properties?

Open todd-a-jacobs opened this issue 2 years ago • 2 comments

While this may or may not require dropping the error correction setting, it seems like contact photos should be supportable. Right now, the contact always imports without a contact photo and there's no way to add one in the builder.

vCard supports encoding the contact image as base64, and that's how Apple normally does it, but that often exceed the character limits of a QR code without structured append. However, there are two possible options:

  1. Using the PHOTO field defined by vCard 4.0, which supports both base64 encoding and a URL scheme. Wikipedia says vCard supports the following PHOTO properties:

    2.1: PHOTO;JPEG:http://example.com/photo.jpg 2.1: PHOTO;JPEG;ENCODING=BASE64:[base64-data] 3.0: PHOTO;TYPE=JPEG;VALUE=URI:http://example.com/photo.jpg 3.0: PHOTO;TYPE=JPEG;ENCODING=b:[base64-data] 4.0: PHOTO;MEDIATYPE=image/jpeg:http://example.com/photo.jpg 4.0: PHOTO;ENCODING=BASE64;TYPE=JPEG:[base64-data]

  2. Using the contact photo as an overlay on the QR code.

    This is less desirable if you want to use the company logo for the overlay, but at least it's an option of a more suitable vCard field can't be used.

My personal preference would be to support PHOTO;MEDIATYPE=image/jpeg:http://example.com/photo.jpg or PHOTO;TYPE=JPEG;VALUE=URI:http://example.com/photo.jpg if they're compatible with iOS devices and/or Apple Contacts. Is that a potential feature enhancement that could be considered?

todd-a-jacobs avatar Sep 25 '23 04:09 todd-a-jacobs

@todd-a-jacobs Thanks for the thoughtful request! You're right that QR Pop is purposefully removing photos from imported contacts. As you mentioned, Apple encodes those images as base64 which easily exceeds the character limit of a QR code. Even for those where the base64 image can fit the codes become so complex as to be practically useless.

That being said, URLs could work! The big caveat would be that there's no way for QR Pop to host contact photos on behalf of users. Doing so wouldn't be sustainable since it's a free app. However, it'd be pretty easy to add a "contact photo URL" field if you think that'd be a good substitution.

I also really like the idea of using a contact photo as an overlay for the QR code and will probably implement that as an option regardless. I'm currently working on improving the image overlay experience so that lines up nicely with that project.

Let me know if you think the URL field would be a workable solution for you. I appreciate the feedback!

git-shawn avatar Sep 26 '23 02:09 git-shawn

However, it'd be pretty easy to add a "contact photo URL" field if you think that'd be a good substitution...Let me know if you think the URL field would be a workable solution for you.

I think the URL field would be fine from the "If you want my picture, here it is!" standpoint. I'm just honestly not sure that Apple's Contacts or other popular contact managers support it directly, which is really the bigger question. If they don't support it directly, then the use case might not be as strong as I imagined; but if they do, then the URL linking to a LinkedIn, GitHub, or other social media headshot or other image would definitely be useful.

I guess I just don't know enough about Apple Contact internals. I know the vCard spec supports it, but whether or not Apple Contacts, CardHop, or anything else would use it seems like the bigger issue. I started with the assumption that if it was in the specs that the contact apps would support it, but now I'm not so sure, and Googling for the answer didn't turn up anything clear-cut in that regard.

I know QR-Pop interfaces with Apple Contacts. Do you happen to know enough about the internals to determine if it would use the URL field if present?

todd-a-jacobs avatar Oct 07 '23 07:10 todd-a-jacobs