feat: Rewrite png metadata handling, new VRC metadata (#1311)

* refactor: Move ScreenshotHelper png parsing to PNGHelper, simplify interface

* refactor: Fix references to screenshotmanager

* fix: Read resolution, not description

* refactor: Rewrite/move all png reading logic into new class

* refactor: Integrate new metadata helper functions

* refactor: Add docs, re-add legacy mods support, change error handling

There are no longer specific errors for each metadata type as it was
just super unnecessary; A verbose log including the exception/string is
now logged to file instead and a generic error is given in the UI.

* fix: Show old vrc beta format images

They were being treated as a non-image
This commit is contained in:
Teacup
2025-08-03 23:05:40 -07:00
committed by GitHub
parent 7b38599193
commit 4e64177722
9 changed files with 769 additions and 508 deletions

View File

@@ -35,7 +35,8 @@ public partial class AppApi
}
}
metadata.Add("fileResolution", ScreenshotHelper.ReadPNGResolution(path));
using var png = new PNGFile(path);
metadata.Add("fileResolution", PNGHelper.ReadResolution(png));
var creationDate = File.GetCreationTime(path);
metadata.Add("creationDate", creationDate.ToString("yyyy-MM-dd HH:mm:ss"));