How to clean exif data in tiff image

How to clean exif data in tiff image

Issue : How to clean exif data in tiff image.

Tips : To clean exif data in tiff image, it is needed to clean needed tags in frames.

Example :

using Aspose.Imaging;
using Aspose.Imaging.Brushes;
using Aspose.Imaging.FileFormats.Png;
using Aspose.Imaging.FileFormats.Svg;
using Aspose.Imaging.FileFormats.Tiff;
using Aspose.Imaging.FileFormats.Tiff.Enums;
using Aspose.Imaging.ImageOptions;
using Aspose.Imaging.Sources;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
string templatesFolder = @"c:\Users\USER\Downloads\templates\";
string dataDir = templatesFolder;
using (TiffImage image = (TiffImage)Image.Load(dataDir + "template.tiff"))
{
image.XmpData = null;
foreach (TiffFrame frame in image.Frames)
{
CleanExifData(frame.FrameOptions);
}
image.Save(dataDir + "result.tiff");
}
File.Delete(dataDir + "result.tiff");
void CleanExifData(TiffOptions frameOptions)
{
frameOptions.Artist = null;
frameOptions.Copyright = null;
frameOptions.DateTime = null;
frameOptions.DocumentName = null;
frameOptions.ImageDescription = null;
frameOptions.PageName = null;
frameOptions.InkNames = null;
frameOptions.ScannerManufacturer = null;
frameOptions.ScannerModel = null;
frameOptions.SoftwareType = null;
frameOptions.TargetPrinter = null;
frameOptions.XPTitle = null;
frameOptions.XPComment = null;
frameOptions.XPAuthor = null;
frameOptions.XPKeywords = null;
frameOptions.XPSubject = null;
}