Browse Source

remove unneeded public constants

af/merge-core
Scott Williams 9 years ago
parent
commit
b19fdd4472
  1. 4
      src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs
  2. 10
      src/ImageSharp/Image/ImageBase{TPixel}.cs

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

@ -120,11 +120,11 @@ namespace SixLabors.ImageSharp.Formats
this.currentStream.Read(palette, 0, colorMapSize);
}
if (this.infoHeader.Width > Image<TPixel>.MaxWidth || this.infoHeader.Height > Image<TPixel>.MaxHeight)
if (this.infoHeader.Width > int.MaxValue || this.infoHeader.Height > int.MaxValue)
{
throw new ArgumentOutOfRangeException(
$"The input bitmap '{this.infoHeader.Width}x{this.infoHeader.Height}' is "
+ $"bigger then the max allowed size '{Image<TPixel>.MaxWidth}x{Image<TPixel>.MaxHeight}'");
+ $"bigger then the max allowed size '{int.MaxValue}x{int.MaxValue}'");
}
Image<TPixel> image = new Image<TPixel>(this.configuration, this.infoHeader.Width, this.infoHeader.Height);

10
src/ImageSharp/Image/ImageBase{TPixel}.cs

@ -19,16 +19,6 @@ namespace SixLabors.ImageSharp
public abstract class ImageBase<TPixel> : IImageBase<TPixel>
where TPixel : struct, IPixel<TPixel>
{
/// <summary>
/// Gets or sets the maximum allowable width in pixels.
/// </summary>
public const int MaxWidth = int.MaxValue;
/// <summary>
/// Gets or sets the maximum allowable height in pixels.
/// </summary>
public const int MaxHeight = int.MaxValue;
#pragma warning disable SA1401 // Fields must be private
/// <summary>
/// The image pixels. Not private as Buffer2D requires an array in its constructor.

Loading…
Cancel
Save