-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
@@ -14,7 +14,8 @@ public class EmbeddedFontLoader : IEmbeddedFontLoader | |||
{ | |||
var tmpdir = IOPath.GetTempPath(); | |||
var filePath = IOPath.Combine(tmpdir, font.FontName); | |||
if (File.Exists(filePath)) | |||
var fileInfo = new FileInfo(filePath); | |||
if (fileInfo.Exists && fileInfo.Length == font.ResourceStream.Length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is using the Length really safe here? It could lead to false positives.
https://stackoverflow.com/questions/1358510/how-to-compare-2-files-fast-using-net
https://docs.microsoft.com/en-us/troubleshoot/dotnet/csharp/create-file-compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this could lead to false positives. Better solution is to create a hash, but i think in most cases it will work.
So i'm not sure what the best/fastest way to implement it in xamarin android. Feel free to create another PR to solve this issue.
@AlleSchonWeg Is this OK to be merged? I just ran into this behavior while working on our Xamarin.Forms app and found this bug & PR. Would be great to have a fix in for the next release! :) |
@nrmiller |
The issue continue in 5.0.0, let's change the target to 5.0.0 and try to include in an upcoming SR. |
@jsuarezruiz |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I even posted the code for doing a hash comparison a while ago in the linked ticket 🙄 Comparing only by length is lazy and unprofessional. |
What is it doing in a comment and not a PR? That almost seems lazy and unprofessional... |
I won't go into a whole discussion here, but Xamarin and Xamarin.Forms are not part of the subscriptions you are paying for. As you can see in the license that is attached to this repo, there is no support and the product is as-is. I don't mind you not doing the work, that is fine. Although I think if you wish to participate in a (healthy) open-source ecosystem, you should consider helping out and that has nothing to do with who gets paid by who, but that's a whole other discussion. What I do mind that you give condescending remarks about other peoples work and calling it lazy and unprofessional and also now being passive aggressive with the last line in your comment. Comments like these do not contribute to any healthy discussion and don't provide anything of value other than potentially ruining people's days. In the future I would ask you to refrain from doing so as it's not only not nice, it also goes against our code of conduct that you agreed to by participating in this repository. I'd love to discuss some things you're mentioning here and give you my view on it, if you want to do it in public so others can join please consider opening a discussion on this repo, or find my email address on my GitHub profile if you want to do it in private. |
Description of Change
Check if a stored fontfile has a different size as the the embedded fontstream. If only the name is checked, changes in the embedded font are not taken into account.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
PR Checklist