private static void WriteAndCheckProfile(IMagickImageCollection images, PsdWriteDefines defines, int expectedLength) { using (MemoryStream memStream = new MemoryStream()) { images.Write(memStream, defines); memStream.Position = 0; images.Read(memStream); CheckProfile(images[1], expectedLength); } }
public void Test_AdditionalInfo() { using (IMagickImageCollection images = new MagickImageCollection()) { images.Read(Files.Coders.LayerStylesSamplePSD); CheckProfile(images[1], 264); var defines = new PsdWriteDefines() { AdditionalInfo = PsdAdditionalInfo.All }; WriteAndCheckProfile(images, defines, 264); defines.AdditionalInfo = PsdAdditionalInfo.Selective; WriteAndCheckProfile(images, defines, 152); defines.AdditionalInfo = PsdAdditionalInfo.None; WriteAndCheckProfile(images, defines, 0); } }
public void ShouldMakeSetWhichAdditionalInfoShouldBeWritten() { using (var images = new MagickImageCollection()) { images.Read(Files.Coders.LayerStylesSamplePSD); CheckProfile(images[1], 264); var defines = new PsdWriteDefines { AdditionalInfo = PsdAdditionalInfoPart.All, }; WriteAndCheckProfile(images, defines, 264); defines.AdditionalInfo = PsdAdditionalInfoPart.Selective; WriteAndCheckProfile(images, defines, 152); defines.AdditionalInfo = PsdAdditionalInfoPart.None; WriteAndCheckProfile(images, defines, 0); } }