Browse Source

Don't allow duplicate image formats.

af/merge-core
James Jackson-South 9 years ago
parent
commit
80faa0af9a
  1. 6
      src/ImageSharp/Bootstrapper.cs

6
src/ImageSharp/Bootstrapper.cs

@ -8,6 +8,7 @@ namespace ImageSharp
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using Formats;
@ -63,7 +64,10 @@ namespace ImageSharp
/// <param name="format">The new format to add.</param>
public void AddImageFormat(IImageFormat format)
{
this.imageFormats.Add(format);
if (this.imageFormats.All(i => i.GetType() != format.GetType()))
{
this.imageFormats.Add(format);
}
}
}
}

Loading…
Cancel
Save