-
Notifications
You must be signed in to change notification settings - Fork 328
Expand file tree
/
Copy pathGifExiftoolTangled3Test.cs
More file actions
43 lines (39 loc) · 1.33 KB
/
GifExiftoolTangled3Test.cs
File metadata and controls
43 lines (39 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using NUnit.Framework;
using TagLib;
using TaglibSharp.Tests.Images.Validators;
namespace TaglibSharp.Tests.Images
{
[TestFixture]
public class GifExiftoolTangled3Test
{
[Test]
public void Test ()
{
// This file is originally created with GIMP and the metadata was modified
// by exiftool. Furthermore, the file is modified in the following way:
// (1) the blocks which contain the metadata are moved to the end of the file.
// This is allowed and should be handled correctly by taglib.
// (2) XMP Block is removed.
ImageTest.Run ("sample_exiftool_tangled3.gif",
true,
new GifExiftoolTangled3TestInvariantValidator (),
NoModificationValidator.Instance,
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, false),
new CommentModificationValidator ("Created with GIMP"),
new TagCommentModificationValidator ("Created with GIMP", TagTypes.GifComment, true),
new RemoveMetadataValidator (TagTypes.GifComment)
);
}
}
public class GifExiftoolTangled3TestInvariantValidator : IMetadataInvariantValidator
{
public void ValidateMetadataInvariants (TagLib.Image.File file)
{
Assert.IsNotNull (file);
Assert.IsNotNull (file.Properties);
Assert.AreEqual (12, file.Properties.PhotoWidth);
Assert.AreEqual (37, file.Properties.PhotoHeight);
}
}
}