Browse Source

Fixing multiple lines warnings.

pull/49/head
Olivia 9 years ago
parent
commit
de43c8be39
  1. 4
      src/ImageSharp/Formats/Jpg/JpegDecoderCore.cs
  2. 12
      src/ImageSharp/Formats/Jpg/JpegEncoderCore.cs

4
src/ImageSharp/Formats/Jpg/JpegDecoderCore.cs

@ -388,7 +388,7 @@ namespace ImageSharp.Formats
this.ProcessApp14Marker(remaining); this.ProcessApp14Marker(remaining);
break; break;
default: default:
if ((JpegConstants.Markers.APP0 <= marker && marker <= JpegConstants.Markers.APP15) if ((marker >= JpegConstants.Markers.APP0 && marker <= JpegConstants.Markers.APP15)
|| marker == JpegConstants.Markers.COM) || marker == JpegConstants.Markers.COM)
{ {
this.Skip(remaining); this.Skip(remaining);
@ -1488,7 +1488,7 @@ namespace ImageSharp.Formats
ah = this.temp[3 + scanComponentCountX2] >> 4; ah = this.temp[3 + scanComponentCountX2] >> 4;
al = this.temp[3 + scanComponentCountX2] & 0x0f; al = this.temp[3 + scanComponentCountX2] & 0x0f;
if ((zigStart == 0 && zigEnd != 0) || zigStart > zigEnd || BlockF.BlockSize <= zigEnd) if ((zigStart == 0 && zigEnd != 0) || zigStart > zigEnd || zigEnd >= BlockF.BlockSize)
{ {
throw new ImageFormatException("Bad spectral selection bounds"); throw new ImageFormatException("Bad spectral selection bounds");
} }

12
src/ImageSharp/Formats/Jpg/JpegEncoderCore.cs

@ -31,6 +31,7 @@ namespace ImageSharp.Formats
39, 46, 53, 60, 61, 54, 47, 55, 62, 63, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63,
}; };
#pragma warning disable SA1118 // ParameterMustNotSpanMultipleLines
/// <summary> /// <summary>
/// The Huffman encoding specifications. /// The Huffman encoding specifications.
/// This encoder uses the same Huffman encoding for all images. /// This encoder uses the same Huffman encoding for all images.
@ -43,7 +44,10 @@ namespace ImageSharp.Formats
{ {
0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
}, },
new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }), new byte[]
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
}),
new HuffmanSpec( new HuffmanSpec(
new byte[] new byte[]
{ {
@ -75,7 +79,10 @@ namespace ImageSharp.Formats
{ {
0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
}, },
new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }), new byte[]
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
}),
// Chrominance AC. // Chrominance AC.
new HuffmanSpec( new HuffmanSpec(
@ -105,6 +112,7 @@ namespace ImageSharp.Formats
0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa
}) })
}; };
#pragma warning restore SA1118 // ParameterMustNotSpanMultipleLines
/// <summary> /// <summary>
/// The compiled representations of theHuffmanSpec. /// The compiled representations of theHuffmanSpec.

Loading…
Cancel
Save