fix: Wrong keyword encoding, bad buffer, update cache fix

Was using ASCII for keyword and was generating inconsistent CRC whoops
This commit is contained in:
Teacup
2025-08-08 17:57:55 -07:00
committed by Natsumi
parent 06e06a7164
commit 7fe8f4e079
4 changed files with 23 additions and 17 deletions

View File

@@ -209,7 +209,7 @@ namespace VRCX
// Check for chunk only present in files created by older modded versions of vrchat. (LFS, screenshotmanager), which put their metadata at the end of the file (which is not in spec bro).
// Searching from the end of the file is a slower bruteforce operation so only do it if we have to.
if (result.Count == 0 && pngFile.GetChunk(PNGChunkTypeFilter.sRGB).HasValue)
if (result.Count == 0 && pngFile.GetChunk(PNGChunkTypeFilter.sRGB) != null)
{
var lfsMetadata = PNGHelper.ReadTextChunk("Description", pngFile, true);
@@ -233,7 +233,11 @@ namespace VRCX
{
using var pngFile = new PNGFile(path);
var chunk = PNGHelper.GenerateTextChunk("Description", text);
return pngFile.WriteChunk(chunk);
pngFile.WriteChunk(chunk);
DeleteTextMetadata(path, true);
return true;
}
public static ScreenshotMetadata ParseVRCImage(string xmlString)