示例#1
0
        private static void CheckProfile(IMagickImage image, int expectedLength)
        {
            var profile      = image.GetProfile("psd:additional-info");
            int actualLength = profile?.ToByteArray().Length ?? 0;

            Assert.AreEqual(expectedLength, actualLength);
        }
示例#2
0
        /// <summary>
        /// Creates additional info from a <see cref="MagickFormat.Psd"/> image.
        /// </summary>
        /// <param name="image">The image to create the additonal info from.</param>
        /// <returns>The additional info from a <see cref="MagickFormat.Psd"/> image.</returns>
        public static PsdAdditionalInfo FromImage(IMagickImage <QuantumType> image)
        {
            Throw.IfNull(nameof(image), image);

            var profile = image.GetProfile("psd:additional-info");

            if (profile == null)
            {
                return(null);
            }

            var bytes = profile.ToByteArray();

            return(ParseAdditionalInfo(bytes));
        }