Skip to content

Commit 9cb8d98

Browse files
committed
Added unit test for #1764.
1 parent ae37960 commit 9cb8d98

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/Magick.NET.Tests/Coders/TheJpegCoder.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
22
// Licensed under the Apache License, Version 2.0.
33

4+
using System;
45
using System.IO;
56
using ImageMagick;
67
using Xunit;
@@ -57,4 +58,26 @@ public void ShouldWriteTheXmpProfileToTheImage()
5758
Assert.NotNull(result);
5859
Assert.True(result.Equals(profile));
5960
}
61+
62+
[Fact]
63+
public void ShouldSupportWritingExifProfileWithMaxLength()
64+
{
65+
using var input = new MagickImage(Files.FujiFilmFinePixS1ProJPG);
66+
67+
var profile = input.GetExifProfile();
68+
Assert.NotNull(profile);
69+
70+
var data = profile.ToByteArray();
71+
Assert.NotNull(data);
72+
73+
Array.Resize(ref data, 65533);
74+
input.SetProfile(new ImageProfile("exif", data));
75+
76+
data = input.ToByteArray(MagickFormat.Jpeg);
77+
78+
using var output = new MagickImage(data);
79+
80+
profile = output.GetExifProfile();
81+
Assert.NotNull(profile);
82+
}
6083
}

0 commit comments

Comments
 (0)