Browse Source

Added extra test for trimming comments.

pull/22/merge
Dirk Lemstra 9 years ago
committed by Dirk Lemstra
parent
commit
3a0697b093
  1. 23
      tests/ImageSharp.Tests/Formats/Gif/GifEncoderCoreTests.cs

23
tests/ImageSharp.Tests/Formats/Gif/GifEncoderCoreTests.cs

@ -63,5 +63,28 @@ namespace ImageSharp.Tests
}
}
}
[Fact]
public void Encode_CommentIsToLong_CommentIsTrimmed()
{
using (Image input = new Image(1, 1))
{
string comments = new string('c', 256);
input.MetaData.Properties.Add(new ImageProperty("Comments", comments));
using (MemoryStream memStream = new MemoryStream())
{
input.Save(memStream, new GifFormat());
memStream.Position = 0;
using (Image output = new Image(memStream))
{
Assert.Equal(1, output.MetaData.Properties.Count);
Assert.Equal("Comments", output.MetaData.Properties[0].Name);
Assert.Equal(255, output.MetaData.Properties[0].Value.Length);
}
}
}
}
}
}

Loading…
Cancel
Save