Skip to content

Commit

Permalink
Fixing incomplete byte read for images
Browse files Browse the repository at this point in the history
  • Loading branch information
eriadam authored and BalintBende committed Jun 13, 2024
1 parent f22f47d commit d911a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bcf-toolkit/Utils/ZipArchiveEntryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static string Snapshot(this ZipArchiveEntry entry) {
var extension = entry.FullName.Split(".").Last();
var mime = $"data:image/{extension};base64";
var buffer = new byte[entry.Length];
var image = entry
entry
.Open()
.Read(buffer, 0, buffer.Length);
.ReadExactly(buffer, 0, buffer.Length);
var base64String = Convert.ToBase64String(buffer);
return $"{mime},{base64String}";
}
Expand Down

0 comments on commit d911a85

Please sign in to comment.