Resource

Resource Basics

Resource Name Remove all existing XMP
Resource Version 1.2
Category Metadata
Downloads 2009
Release Date 11/17/2014 5:07:28 PM
 

Resource Details

Description For every selected thumbnails, this script will remove the full XMP from the catalog and the image file.

USE WITH CARE
Installation Instructions Download the script to your hard drive
Usage Instructions 1. Select one or more thumbs for which you want to delete XMP
2. Select Tools->Scripter
3. Open the downloaded script
4. Ruin the script with the run button
Changes in this version 1.2 made compatible with PSU
Special Requirements
 

Author Information

Author Name IDimager Support
 

Script

{
  Description: This script will remove the full XMP from the selected images
  Author: IDimager
  Initial date: 2006-12-18
}

var
  ATif: TTif;
  ATag: TTifTag;
  i: Integer;
begin
  if Selected.Count = 0 then
  begin
    Say ('No selection made.');
    exit;
  end;

  if not Ask ('Are you sure you want to remove full XMP for the selected images?') then
    exit;

  Progress.Cancel := False;
  Progress.ProgressBar := True;
  Progress.Max := Selected.Count;
  Progress.Show;

  ATif := TTif.Create (nil);
    for i := 0 to Selected.Count - 1 do
    begin
      Progress.ProgressText := Selected.Items[i].FileName;
      Progress.Pos := i + 1;
      if Progress.Cancel then
        break;

      if not Selected.Items[i].CanUpdateExif then
        Continue;

      // first delete the XMP from the catalog
      Catalog.DeleteXMPForImage (Selected.Items[i]);

      // then remove the XMP from the image itself
      ATif.Reset;
      ATif.FileName := Selected.Items[i].ExifFileName;

      ATif.Load (True, False);

      ATif.RemoveXMP;

      ATif.UpdateTags;
    end;
  ATif.Free;

  Progress.Hide;

  if Progress.Cancel then
    Say ('Cancelled');
end;