Browse Source

- fixed error message in WriteExifProfile, when Exif data exceeds the limits

- fixed some typo's
pull/616/head
popow 8 years ago
parent
commit
f32e68ac82
  1. 8
      src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs
  2. 4
      src/ImageSharp/Formats/Png/PngDecoderCore.cs

8
src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs

@ -430,7 +430,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <param name="verticalResolution">The resolution of the image in the y- direction.</param>
private void WriteApplicationHeader(short horizontalResolution, short verticalResolution)
{
// Write the start of image marker. Markers are always prefixed with with 0xff.
// Write the start of image marker. Markers are always prefixed with 0xff.
this.buffer[0] = JpegConstants.Markers.XFF;
this.buffer[1] = JpegConstants.Markers.SOI;
@ -617,7 +617,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
if (data.Length > Max)
{
throw new ImageFormatException($"Exif profile size exceeds limit. nameof{Max}");
throw new ImageFormatException($"Exif profile size exceeds limit of {Max} bytes.");
}
int length = data.Length + 2;
@ -640,7 +640,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// </exception>
private void WriteIccProfile(IccProfile iccProfile)
{
// Just incase someone set the value to null by accident.
// Just in-case someone set the value to null by accident.
if (iccProfile == null)
{
return;
@ -896,7 +896,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg
/// <param name="length">The marker length.</param>
private void WriteMarkerHeader(byte marker, int length)
{
// Markers are always prefixed with with 0xff.
// Markers are always prefixed with 0xff.
this.buffer[0] = JpegConstants.Markers.XFF;
this.buffer[1] = marker;
this.buffer[2] = (byte)(length >> 8);

4
src/ImageSharp/Formats/Png/PngDecoderCore.cs

@ -1162,7 +1162,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// <summary>
/// Decodes and assigns marker colors that identify transparent pixels in non indexed images
/// </summary>
/// <param name="alpha">The aplha tRNS array</param>
/// <param name="alpha">The alpha tRNS array</param>
private void AssignTransparentMarkers(ReadOnlySpan<byte> alpha)
{
if (this.pngColorType == PngColorType.Rgb)
@ -1209,7 +1209,7 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary>
/// <typeparam name="TPixel">The type of pixel we are expanding to</typeparam>
/// <param name="scanline">The defiltered scanline</param>
/// <param name="row">Thecurrent output image row</param>
/// <param name="row">The current output image row</param>
private void ProcessScanlineFromPalette<TPixel>(ReadOnlySpan<byte> scanline, Span<TPixel> row)
where TPixel : struct, IPixel<TPixel>
{

Loading…
Cancel
Save