File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
tests/Magick.NET.Tests/Coders Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 11// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
22// Licensed under the Apache License, Version 2.0.
33
4+ using System ;
45using System . IO ;
56using ImageMagick ;
67using 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}
You can’t perform that action at this time.
0 commit comments