|
|
@ -83,28 +83,19 @@ internal sealed class IccReader |
|
|
{ |
|
|
{ |
|
|
IccTagTableEntry[] tagTable = ReadTagTable(reader); |
|
|
IccTagTableEntry[] tagTable = ReadTagTable(reader); |
|
|
List<IccTagDataEntry> entries = new(tagTable.Length); |
|
|
List<IccTagDataEntry> entries = new(tagTable.Length); |
|
|
Dictionary<uint, IccTagDataEntry> store = new(); |
|
|
|
|
|
|
|
|
|
|
|
foreach (IccTagTableEntry tag in tagTable) |
|
|
foreach (IccTagTableEntry tag in tagTable) |
|
|
{ |
|
|
{ |
|
|
IccTagDataEntry entry; |
|
|
IccTagDataEntry entry; |
|
|
if (store.TryGetValue(tag.Offset, out IccTagDataEntry? value)) |
|
|
|
|
|
|
|
|
try |
|
|
{ |
|
|
{ |
|
|
entry = value; |
|
|
entry = reader.ReadTagDataEntry(tag); |
|
|
} |
|
|
} |
|
|
else |
|
|
catch |
|
|
{ |
|
|
{ |
|
|
try |
|
|
// Ignore tags that could not be read
|
|
|
{ |
|
|
continue; |
|
|
entry = reader.ReadTagDataEntry(tag); |
|
|
|
|
|
} |
|
|
|
|
|
catch |
|
|
|
|
|
{ |
|
|
|
|
|
// Ignore tags that could not be read
|
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
store.Add(tag.Offset, entry); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
entry.TagSignature = tag.Signature; |
|
|
entry.TagSignature = tag.Signature; |
|
|
|