Exemple #1
0
        /// <summary>
        /// Adds an EXIF property to an image.
        /// </summary>
        /// <param name="inputPath">file path of original image</param>
        /// <param name="outputPath">file path of modified image</param>
        /// <param name="property"></param>
        public static void AddExifData(string inputPath, string outputPath, ExifProperty property)
        {
            // minimally load image
            Image image;

            using (ExifReader.LoadImage(inputPath, out image))
            {
                using (image)
                {
                    ExifWriter.AddExifData(image, property);
                    image.Save(outputPath);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Adds a collection of EXIF properties to an image.
        /// </summary>
        /// <param name="image"></param>
        /// <param name="properties"></param>
        public static void AddExifData(Image image, ExifPropertyCollection properties)
        {
            if (image == null)
            {
                throw new ArgumentNullException("image");
            }

            if (properties == null || properties.Count < 1)
            {
                return;
            }

            foreach (ExifProperty property in properties)
            {
                ExifWriter.AddExifData(image, property);
            }
        }