Browse Source

Update IccReader.cs

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

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

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

Loading…
Cancel
Save