Feedback

C# - Clean Exif Data in C# WPF

Veröffentlicht von am 7/6/2016
(0 Bewertungen)
Clean exif data from images. Used classes can be found here: https://github.com/SeppPenner/ExifCleaner
using System.Collections.ObjectModel;
using System.Windows;
using ExifRemove.Events;
using ExifRemove.Implementation;
using ExifRemove.Interfaces;
using ExifRemove.Models;
using MessageBox = System.Windows.MessageBox;

namespace ExifRemove.Example
{
    public class ExifCleanerExample
    {
        private readonly ObservableCollection<ExifItem> _exifItems = new ObservableCollection<ExifItem>();
        private IExifCleaner _cleaner;

        public ExifCleanerExample()
        {
            SetHandlerAndStart("C\\Users\\abc\\Test");
        }

        private void InitializeHandler()
        {
            _cleaner.ExifCleanCompleted += HandleCleanCompleted;
            _cleaner.ExifCleanProgress += HandleCleanProcess;
            _cleaner.ExceptionThrown += HandleExceptionThrown;
        }

        private void SetHandlerAndStart(string outPath)
        {
            _cleaner = new ExifCleaner(outPath, _exifItems);
            InitializeHandler();
            _cleaner.Start();
        }

        private void HandleCleanCompleted(object sender, ExifCleanCompletedEventArgs e)
        {
            MessageBox.Show(e.Text, "Exif remover", MessageBoxButton.OK,
                MessageBoxImage.Information);
        }

        private void HandleCleanProcess(object sender, ExifCleanProgressEventArgs e)
        {
            MessageBox.Show(e.Text, "Exif remover", MessageBoxButton.OK,
                MessageBoxImage.Information);
        }

        private void HandleExceptionThrown(object sender, ExceptionThrownEventArgs e)
        {
            MessageBox.Show(e.Message, "Exif remover", MessageBoxButton.OK,
                MessageBoxImage.Information);
        }
    }
}
Abgelegt unter c#, Exif, clean, remove.

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!