Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new <see cref="HeifMetadata"/> from the specified data.
 /// </summary>
 /// <param name="input">The data to load the metadata from.</param>
 /// <returns>A new <see cref="HeifMetadata"/>.</returns>
 public static HeifMetadata GetMetadata(byte[] input)
 {
     using (var context = new HeifContext(input))
     {
         using (var handle = new HeifImageHandle(context))
         {
             return(handle.ToMetadata());
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new collection of <see cref="HeifMetadata"/> from the specified data.
        /// </summary>
        /// <param name="input">The data to load the metadata from.</param>
        /// <returns>A new <see cref="HeifMetadata"/>.</returns>
        public static IReadOnlyCollection <HeifMetadata> GetCollectionMetadata(byte[] input)
        {
            using (var context = new HeifContext(input))
            {
                var result = new List <HeifMetadata>();
                foreach (var imageId in context.GetImageIds())
                {
                    using (var handle = new HeifImageHandle(context, imageId))
                    {
                        result.Add(handle.ToMetadata());
                    }
                }

                return(result);
            }
        }