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);
}
}
}
Kommentare zum Snippet