Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Not a Bug] VCF Nextcloud, library not parsing photo actual content properly #6

Closed
usselite opened this issue Jun 16, 2023 · 5 comments

Comments

@usselite
Copy link

usselite commented Jun 16, 2023

Describe the bug
In Nextcloud 25 - create a new contact, add a photo to the contact. Generates attached VCF. When library parses the VCF file it is missing out on the actual photo it's base64 content. It does seem to recognize the Encoding and MediaType.

To Reproduce
Code to reproduce the behavior:

string contentsVCFFile = ...
var convertedItem = VCard.ParseVcf(contentsVCFFile );

Expected behavior

I'd expect the base64 value to be available.

Desktop (please complete the following information):

  • OS: Windows 11
  • .NET Version: 6.0
  • Library version: 4.0

Additional context
See attachment for example file:
3eddee69-e082-42b6-b740-beebf2457f11.txt

@FolkerKinzel FolkerKinzel changed the title [Bug] VCF Nextcloud, library not parsing photo actual content properly [Not a Bug] VCF Nextcloud, library not parsing photo actual content properly Jun 17, 2023
@FolkerKinzel
Copy link
Owner

Your photo is too large. You can reduce the size of your photo or (better) put your photo somewhere on the web and reference it with an URI.
The data model of the library is based on the vCard 4.0 format. This specifies that embedded data content should be an URI. That's why the DataUrl class is derived from the System.Uri class with its restriction of a maximum length of 65519 characters.
The main goal of this restriction is that vCards should be small files, because they are used, e.g., for CARDDAV. Imagine thousands of vCard files, each one larger than 100 MB - that would bring each server down. I don't want to be guilty for such things.
The DataUrl class is used for both - reading and writing. I will think over it to remove the length restriction for reading in a future version, but I think there should be at least one for writing.

@FolkerKinzel FolkerKinzel closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
@usselite
Copy link
Author

Hi @FolkerKinzel I understand on why there's a limitation (agree of file size). In this case the VCF file was generated by Nextcloud itself (and choose a default photo). - There are no limitations in place on their end though.

Is there currently another way to retrieve the original contents or do I have to manually extract it?

@usselite
Copy link
Author

usselite commented Oct 3, 2023

@FolkerKinzel any chance that you will review this limit again?

Personally I believe that the library should not have such a limit build in, this is something the server should address (or maintainer). Or at least have some override for this.

@FolkerKinzel
Copy link
Owner

Hi @usselite,
Version 6.0.0 won't have a size limit anymore. After thinking about it for a long time, I came to the same conclusion: The size restriction can better be done by the application, e.g., measuring the size of the VCF file before loading it. One reason for this is also that vCard 4.0 allows an unlimit number of embedded photos inside one vCard.
A preview of version 6.0.0 will be available on nuget soon. If you can't wait you can download the repository and compile it yourself in the meantime.

@FolkerKinzel FolkerKinzel reopened this Oct 10, 2023
@FolkerKinzel
Copy link
Owner

Hi @usselite,
Version 6.0.0-beta.1 is now available at nuget. This version fixes your issue. (The final release is coming soon.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants