Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="HeifImage"/> from the specified data.
        /// </summary>
        /// <param name="input">The data to load the image from.</param>
        /// <returns>A new <see cref="HeifImage"/> instance.</returns>
        public static HeifImage Decode(byte[] input)
        {
            HeifContext?    context = null;
            HeifImageHandle?handle  = null;

            try
            {
                context = new HeifContext(input);
                handle  = new HeifImageHandle(context);

                return(new HeifImage(context, handle));
            }
            catch
            {
                handle?.Dispose();
                context?.Dispose();

                throw;
            }
        }