mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-24 01:03:50 +02:00
Delete screenshot metadata
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -43,7 +43,7 @@ public class PNGFile : IDisposable
|
||||
ReadAndCacheMetadata();
|
||||
|
||||
var chunk = metadataChunkCache.FirstOrDefault((chunk) => chunkTypeFilter.HasFlag(chunk.ChunkTypeEnum));
|
||||
if (chunk.IsZero())
|
||||
if (chunk == null || chunk.IsZero())
|
||||
return null;
|
||||
|
||||
return chunk;
|
||||
@@ -60,7 +60,7 @@ public class PNGFile : IDisposable
|
||||
public PNGChunk? GetChunkReverse(PNGChunkTypeFilter chunkTypeFilter)
|
||||
{
|
||||
var chunk = ReadChunkReverse(chunkTypeFilter);
|
||||
if (chunk != null && chunk.IsZero())
|
||||
if (chunk == null || chunk.IsZero())
|
||||
return null;
|
||||
|
||||
return chunk;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace VRCX
|
||||
/// If true, the function searches from the end of the file using a reverse search bruteforce method.
|
||||
/// </param>
|
||||
/// <returns>The text associated with the specified keyword, or null if not found.</returns>
|
||||
public static string ReadTextChunk(string keyword, PNGFile pngFile, bool legacySearch = false)
|
||||
public static string? ReadTextChunk(string keyword, PNGFile pngFile, bool legacySearch = false)
|
||||
{
|
||||
// Search for legacy text chunks created by old vrchat mods
|
||||
if (legacySearch)
|
||||
|
||||
Reference in New Issue
Block a user