Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

Clear exif data from picture

Description
Save of copies without exif data from selected pictures files.
Language
C#.net
Minimum Version
Created By
KarolPiechoczek
Contributors
-
Date Created
Dec 17, 2021
Date Last Modified
Dec 17, 2021

Scripted Function (Macro) Code

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.IO;
using System.Threading;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
	public static void Run()
	{
		BFS.Clipboard.Copy();
        List<string> images = new List<string>();
        foreach (string imageFile in Clipboard.GetFileDropList())
        {
            images.Add(imageFile);
        }

        if (images != null || images.Count != 0)
        {
            foreach (var image in images)
            {
                Bitmap bmp = new Bitmap(image);
                foreach (PropertyItem item in bmp.PropertyItems)
                {
                    item.Value = new byte[] { 0 };
                    bmp.SetPropertyItem(item);
                }
                bmp.Save(Path.GetDirectoryName(image)+"\\"+Path.GetFileNameWithoutExtension(image)+"NO_EXIF."+Path.GetExtension(image));
            }
        }
	}
}