Skip to content

Commit

Permalink
Added unit test for #1764.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Dec 16, 2024
1 parent ae37960 commit 9cb8d98
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Magick.NET.Tests/Coders/TheJpegCoder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.

using System;
using System.IO;
using ImageMagick;
using Xunit;
Expand Down Expand Up @@ -57,4 +58,26 @@ public void ShouldWriteTheXmpProfileToTheImage()
Assert.NotNull(result);
Assert.True(result.Equals(profile));
}

[Fact]
public void ShouldSupportWritingExifProfileWithMaxLength()
{
using var input = new MagickImage(Files.FujiFilmFinePixS1ProJPG);

var profile = input.GetExifProfile();
Assert.NotNull(profile);

var data = profile.ToByteArray();
Assert.NotNull(data);

Array.Resize(ref data, 65533);
input.SetProfile(new ImageProfile("exif", data));

data = input.ToByteArray(MagickFormat.Jpeg);

using var output = new MagickImage(data);

profile = output.GetExifProfile();
Assert.NotNull(profile);
}
}

0 comments on commit 9cb8d98

Please sign in to comment.