Browse Source

renamed ImageFormats.Bitmap to ImageFormats.Bmp for more consistent naming

pull/299/head
Anton Firszov 9 years ago
parent
commit
e452646053
  1. 4
      src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs
  2. 2
      src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs
  3. 2
      src/ImageSharp/Formats/Bmp/ImageExtensions.cs
  4. 2
      src/ImageSharp/ImageFormats.cs
  5. 4
      tests/ImageSharp.Tests/ConfigurationTests.cs
  6. 2
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

4
src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs

@ -11,8 +11,8 @@ namespace SixLabors.ImageSharp.Formats.Bmp
/// <inheritdoc/>
public void Configure(Configuration config)
{
config.SetEncoder(ImageFormats.Bitmap, new BmpEncoder());
config.SetDecoder(ImageFormats.Bitmap, new BmpDecoder());
config.SetEncoder(ImageFormats.Bmp, new BmpEncoder());
config.SetDecoder(ImageFormats.Bmp, new BmpDecoder());
config.AddImageFormatDetector(new BmpImageFormatDetector());
}
}

2
src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs

@ -18,7 +18,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp
{
if (this.IsSupportedFileFormat(header))
{
return ImageFormats.Bitmap;
return ImageFormats.Bmp;
}
return null;

2
src/ImageSharp/Formats/Bmp/ImageExtensions.cs

@ -35,6 +35,6 @@ namespace SixLabors.ImageSharp
/// <exception cref="System.ArgumentNullException">Thrown if the stream is null.</exception>
public static void SaveAsBmp<TPixel>(this Image<TPixel> source, Stream stream, BmpEncoder encoder)
where TPixel : struct, IPixel<TPixel>
=> source.Save(stream, encoder ?? source.Configuration.FindEncoder(ImageFormats.Bitmap));
=> source.Save(stream, encoder ?? source.Configuration.FindEncoder(ImageFormats.Bmp));
}
}

2
src/ImageSharp/ImageFormats.cs

@ -32,6 +32,6 @@ namespace SixLabors.ImageSharp
/// <summary>
/// The format details for the bitmaps.
/// </summary>
public static readonly IImageFormat Bitmap = new BmpFormat();
public static readonly IImageFormat Bmp = new BmpFormat();
}
}

4
tests/ImageSharp.Tests/ConfigurationTests.cs

@ -87,7 +87,7 @@ namespace SixLabors.ImageSharp.Tests
});
Assert.Throws<ArgumentNullException>(() =>
{
DefaultConfiguration.SetEncoder(ImageFormats.Bitmap, null);
DefaultConfiguration.SetEncoder(ImageFormats.Bmp, null);
});
Assert.Throws<ArgumentNullException>(() =>
{
@ -104,7 +104,7 @@ namespace SixLabors.ImageSharp.Tests
});
Assert.Throws<ArgumentNullException>(() =>
{
DefaultConfiguration.SetDecoder(ImageFormats.Bitmap, null);
DefaultConfiguration.SetDecoder(ImageFormats.Bmp, null);
});
Assert.Throws<ArgumentNullException>(() =>
{

2
tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.Tests
new PngImageFormatDetector());
configuration.ConfigureCodecs(
ImageFormats.Bitmap,
ImageFormats.Bmp,
SystemDrawingReferenceDecoder.Instance,
SystemDrawingReferenceEncoder.Png,
new PngImageFormatDetector());

Loading…
Cancel
Save