Browse Source

fix incorrect comparison

af/merge-core
Johannes Bildstein 9 years ago
parent
commit
310a28bea7
  1. 20
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs

20
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs

@ -90,7 +90,7 @@ namespace ImageSharp
if (base.Equals(other) && other is IccChromaticityTagDataEntry entry)
{
return this.ColorantType == entry.ColorantType
&& this.ChannelValues.SequenceEqual(entry.ChannelValues);
&& this.EqualsChannelValues(entry);
}
return false;
@ -138,5 +138,23 @@ namespace ImageSharp
throw new ArgumentException("Unrecognized colorant encoding");
}
}
private bool EqualsChannelValues(IccChromaticityTagDataEntry entry)
{
if (this.ChannelValues.Length != entry.ChannelValues.Length)
{
return false;
}
for (int i = 0; i < this.ChannelValues.Length; i++)
{
if (!this.ChannelValues[i].SequenceEqual(entry.ChannelValues[i]))
{
return false;
}
}
return true;
}
}
}

Loading…
Cancel
Save