Browse Source

Update IccReader.cs

pull/1567/head
James Jackson-South 3 years ago
parent
commit
d89d8c5b19
  1. 11
      src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs

11
src/ImageSharp/Metadata/Profiles/ICC/IccReader.cs

@ -83,17 +83,11 @@ 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))
{
entry = value;
}
else
{
try try
{ {
entry = reader.ReadTagDataEntry(tag); entry = reader.ReadTagDataEntry(tag);
@ -104,9 +98,6 @@ internal sealed class IccReader
continue; continue;
} }
store.Add(tag.Offset, entry);
}
entry.TagSignature = tag.Signature; entry.TagSignature = tag.Signature;
entries.Add(entry); entries.Add(entry);
} }

Loading…
Cancel
Save