Class TXMP

Unit

Declaration

type TXMP = class(TObject)

Description

TXMP

Hierarchy

  • TObject
  • TXMP

Overview

Methods

Public constructor Create (AMapped: Boolean = True); reintroduce; virtual;
Public procedure AfterConstruction; override;
Public procedure BeforeDestruction; override;
Public function IsValidXMP (AXmp: TxomStrings): Boolean;
Public function XMLValueFromContent (AParam: TMacroParam): WideString;
Public function ContentFromXMLValue (AParam: TMacroParam; const AValue: Variant): Variant;
Public procedure InitializeFromTif (ATif: TTif; AProcessTiff: Boolean = True; AProcessExif: Boolean = True; AProcessIPTC: Boolean = True; AProcessXMP: Boolean = False; AUpdateState: TTifToXMPUpdateState = txusAll);
Public procedure InitializeFromTifFile (const AFileName: WideString; AProcessTiff: Boolean = True; AProcessExif: Boolean = True; AProcessIPTC: Boolean = True; AMapFromExifAndIPTC: Boolean = False);
Public procedure PushToTif (ATif: TTif);
Public function AddPropertyToDesign (const AProperty: WideString): TMacroParam;
Public function AddParamToDesign (AParam: TMacroParam; AIsMappedParam: Boolean): TMacroParam;
Public procedure DumpToStrings(AResult: TxomStrings); virtual;
Public procedure DumpParamsToStrings(AResult: TxomStrings); virtual;
Public function AddKeywords (AKeywords: TxomStrings; AFullReplace: Boolean): TMacroParam;
Public function EnumKeywords (AKeywords: TxomStrings): Boolean;
Public procedure RemoveTechnical (AFull: Boolean = False; AMultiMode: Boolean = False);
Public procedure RemoveEmpty;
Public procedure RemoveNonCascadable (AList: TxomStringList = nil);
Public function RemoveRecipe: Boolean;
Public procedure ChangeEditStateForFilled (ANewState: TMacroParamEditState);
Public function HasTechnical: Boolean;
Public procedure IntersectWithXMP(AXmp: TXMP); virtual;
Public procedure DifferenceWithXMP(AXmp: TXMP); virtual;
Public procedure AppendXMP(AXmp: TXMP); virtual;
Public procedure MergeXMP(AXmp: TXMP); virtual;
Public function Load (const AFileName, AHostFileName: WideString; ACheckIPTC: Boolean): Boolean;
Public function Save (const AFileName, AHostFileName: WideString; AUpdateIPTC: Boolean): Boolean;
Public function LoadFromImage (const AFileName: WideString; ACheckIPTC: Boolean = True): Boolean;
Public function SaveToImage (const AFileName: WideString; AUpdateIPTC: Boolean = True): Boolean;
Public function LoadFromFile (const AFileName: WideString): Boolean;
Public procedure LoadFromResourceStream (AStream: TStream; const ASchemaURL: WideString = '');
Public procedure LoadFromStream (AStream: TStream);
Public procedure SaveToStream (AStream: TStream);
Public procedure SaveToResourceStream (AStream: TStream);
Public function SaveToFile (const AFileName, AHostFileName: WideString): Boolean;
Public function SaveToStrings (AStrings: TxomStrings; ANeatFormatted: Boolean = False): Boolean;
Public function LoadFromStrings (AStrings: TxomStrings; const ASchemaURL: WideString = ''): Boolean;
Public function SaveAsString: WideString;
Public function LoadFromString (const AString: WideString): Boolean;
Public function ImportFromFile (const AFileName: WideString; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False): Boolean;
Public function ImportFromStrings (AStrings: TxomStrings; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False): Boolean;
Public function ImportFromXMP (AXMP: TXMP; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False): Boolean;
Public procedure ImportMeta (const AFileName: WideString; AProcessTiff: Boolean = True; AProcessExif: Boolean = True; AProcessIPTC: Boolean = True);
Public procedure RemoveParamCommands (AList: TxomStrings);
Public procedure RemoveParam (const AParamCommand: WideString);
Public procedure PostLoad (const AHostFileName: WideString; ATifUpdateState: TTifToXMPUpdateState = txusAll);
Public procedure AddGPSStamp (ALat, ALon, AAlt: Double; AGPSStampDate: TDateTime = 0);
Public function GetGPSStamp (out ALat: Double; out ALon: Double; out AAlt: Double; out AGPSStampDate: TDateTime): Boolean;
Public procedure SetGPSGMTStamp (ALat, ALon, AAlt: Double; AGPSStampDate: TDateTime = 0; ATimeZoneOffset: Double = 0);
Public function GetGPSGMTStamp (out ALat: Double; out ALon: Double; out AAlt: Double; out AGPSStampDate: TDateTime): Boolean;
Public procedure RemoveExif;
Public procedure RemoveGPS;
Public function GEOForwardLookup (const ALocation: WideString; const ALanguage: String): Boolean;
Public function GEOReverseLookup (ALat, ALon: Double; const ALanguage: String): Boolean;
Public function GEOLookupAltitude (ALat, ALon: Double): Boolean;
Public function MapToIPTC (ATif: TTif): Boolean; overload;
Public function MapToIPTC (const AFileName: WideString): Boolean; overload;
Public function MapFromIPTC (ATif: TTif): Boolean; overload;
Public function MapFromIPTC (const AFileName: WideString): Boolean; overload;
Public function MapFromExif (ATif: TTif; ACheckXMP: Boolean = False): Boolean; overload;
Public function MapFromExif (const AFileName: WideString; ACheckXMP: Boolean = False): Boolean; overload;
Public function MapFromExifAndIPTC (ATif: TTif; ACheckXMP: Boolean = False): Boolean; overload;
Public function MapFromExifAndIPTC (const AFileName: WideString; ACheckXMP: Boolean = False): Boolean; overload;
Public procedure ImportParams (AParams: TMacroParams; AIsMappedParams: Boolean; AUpdateXml: Boolean = False; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False; AUpdateEditStates: Boolean = True);
Public function QuickSetProperty (const ANamespace: WideString; const APropertyName: WideString; const AValue: Variant): TMacroParam;
Public function QuickGetProperty (const ANamespace: WideString; const APropertyName: WideString): Variant;
Public function QuickRemoveProperty (const ANamespace: WideString; const APropertyName: WideString): Boolean;
Public function FindProperty (AModel: TXMPModel; const ANamespace, ATag: WideString): TMacroParam;
Public function FindModelProperty (const ANamespace, ATag: WideString): TMacroParam;
Public function FindDesignProperty (const ANamespace, ATag: WideString): TMacroParam;
Public procedure Reset; virtual;
Public procedure DeleteRecipe;
Public function PhotoDate(AZulu: Boolean = False): TDateTime;
Public function PhotoDateOriginal: TDateTime;
Public function PhotoDateDigitized: TDateTime;
Public function PhotoDateDescription: TDateTime;
Public function Orientation: TTifOrientation;
Public function DimensionsXY(var AWidth, AHeight: Integer): WideString;
Public function Dimensions: WideString;
Public procedure UpdateDimensionsXY(AWidth, AHeight: Integer);
Public function Resolution: WideString;
Public function ShortExifString (const ASeparator: WideString = ' '; const AWithTitles: Boolean = False): WideString;
Public function ShorterExifString (const ASeparator: WideString = ' '; const AWithTitles: Boolean = False): WideString;

Properties

Public property FileName: WideString read FFileName write FFilename;
Public property XMPDesign: TXMPModel read FXMPDesign write FXMPDesign;
Public property XMLDocument: TXMLDocument read FXMLDocument;
Public property HasXMP: Boolean read GetHasXMP;
Public property HasGPS: Boolean read GetHasGPS;
Public property HasRecipe: Boolean read GetRecipe;
Public property Changed: Boolean read FChanged write FChanged;
Public property AutoCheckIPTC: Boolean read FAutoCheckIPTC write FAutoCheckIPTC;
Public property UpdateMetadataDate: Boolean read FUpdateMetadataDate write FUpdateMetadataDate;
Public property AdditiveArrayMode: Boolean read FAdditiveArrayMode write FAdditiveArrayMode;
Public property HashKey: AnsiString read GetHashKey;
Public property StoredHashKey: AnsiString read FStoredHashKey write FStoredHashKey;
Public property CleanRead: Boolean read FCleanRead write FCleanRead;
Public property _ConvertToXMPOnlyWhenNoTechnical: Boolean read F_ConvertToXMPOnlyWhenNoTechnical write F_ConvertToXMPOnlyWhenNoTechnical;
Published property Text: WideString read FText write FText;
Published property ReadUnknownSchemas: Boolean read FReadUnknownSchemas write FReadUnknownSchemas;
Published property Mapped: Boolean read FMapped write SetMapped;
Published property KeepHistory: Boolean read FKeepHistory write FKeepHistory;
Published property StorePreservedFileName: Boolean read FStorePreservedFileName write FStorePreservedFileName;

Description

Methods

Public constructor Create (AMapped: Boolean = True); reintroduce; virtual;
 
Public procedure AfterConstruction; override;
 
Public procedure BeforeDestruction; override;
 
Public function IsValidXMP (AXmp: TxomStrings): Boolean;
 
Public function XMLValueFromContent (AParam: TMacroParam): WideString;
 
Public function ContentFromXMLValue (AParam: TMacroParam; const AValue: Variant): Variant;
 
Public procedure InitializeFromTif (ATif: TTif; AProcessTiff: Boolean = True; AProcessExif: Boolean = True; AProcessIPTC: Boolean = True; AProcessXMP: Boolean = False; AUpdateState: TTifToXMPUpdateState = txusAll);
 
Public procedure InitializeFromTifFile (const AFileName: WideString; AProcessTiff: Boolean = True; AProcessExif: Boolean = True; AProcessIPTC: Boolean = True; AMapFromExifAndIPTC: Boolean = False);
 
Public procedure PushToTif (ATif: TTif);
 
Public function AddPropertyToDesign (const AProperty: WideString): TMacroParam;
 
Public function AddParamToDesign (AParam: TMacroParam; AIsMappedParam: Boolean): TMacroParam;
 
Public procedure DumpToStrings(AResult: TxomStrings); virtual;
 
Public procedure DumpParamsToStrings(AResult: TxomStrings); virtual;
 
Public function AddKeywords (AKeywords: TxomStrings; AFullReplace: Boolean): TMacroParam;
 
Public function EnumKeywords (AKeywords: TxomStrings): Boolean;
 
Public procedure RemoveTechnical (AFull: Boolean = False; AMultiMode: Boolean = False);
 
Public procedure RemoveEmpty;
 
Public procedure RemoveNonCascadable (AList: TxomStringList = nil);
 
Public function RemoveRecipe: Boolean;
 
Public procedure ChangeEditStateForFilled (ANewState: TMacroParamEditState);
 
Public function HasTechnical: Boolean;
 
Public procedure IntersectWithXMP(AXmp: TXMP); virtual;

build an XMP that holds overlapping properties between this and another XMP

Public procedure DifferenceWithXMP(AXmp: TXMP); virtual;

build an XMP that holds the symmetric difference between this and another XMP

Public procedure AppendXMP(AXmp: TXMP); virtual;

build an XMP that holds all properties of this and another XMP. If values already exist then their content value is maintained

Public procedure MergeXMP(AXmp: TXMP); virtual;

build an XMP that holds all properties of this and another XMP. If values already exist then their current content value is overwritten with that of the passed XMP

Public function Load (const AFileName, AHostFileName: WideString; ACheckIPTC: Boolean): Boolean;
 
Public function Save (const AFileName, AHostFileName: WideString; AUpdateIPTC: Boolean): Boolean;
 
Public function LoadFromImage (const AFileName: WideString; ACheckIPTC: Boolean = True): Boolean;
 
Public function SaveToImage (const AFileName: WideString; AUpdateIPTC: Boolean = True): Boolean;
 
Public function LoadFromFile (const AFileName: WideString): Boolean;
 
Public procedure LoadFromResourceStream (AStream: TStream; const ASchemaURL: WideString = '');
 
Public procedure LoadFromStream (AStream: TStream);
 
Public procedure SaveToStream (AStream: TStream);
 
Public procedure SaveToResourceStream (AStream: TStream);
 
Public function SaveToFile (const AFileName, AHostFileName: WideString): Boolean;
 
Public function SaveToStrings (AStrings: TxomStrings; ANeatFormatted: Boolean = False): Boolean;
 
Public function LoadFromStrings (AStrings: TxomStrings; const ASchemaURL: WideString = ''): Boolean;
 
Public function SaveAsString: WideString;
 
Public function LoadFromString (const AString: WideString): Boolean;
 
Public function ImportFromFile (const AFileName: WideString; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False): Boolean;
 
Public function ImportFromStrings (AStrings: TxomStrings; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False): Boolean;
 
Public function ImportFromXMP (AXMP: TXMP; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False): Boolean;
 
Public procedure ImportMeta (const AFileName: WideString; AProcessTiff: Boolean = True; AProcessExif: Boolean = True; AProcessIPTC: Boolean = True);
 
Public procedure RemoveParamCommands (AList: TxomStrings);
 
Public procedure RemoveParam (const AParamCommand: WideString);
 
Public procedure PostLoad (const AHostFileName: WideString; ATifUpdateState: TTifToXMPUpdateState = txusAll);
 
Public procedure AddGPSStamp (ALat, ALon, AAlt: Double; AGPSStampDate: TDateTime = 0);
 
Public function GetGPSStamp (out ALat: Double; out ALon: Double; out AAlt: Double; out AGPSStampDate: TDateTime): Boolean;
 
Public procedure SetGPSGMTStamp (ALat, ALon, AAlt: Double; AGPSStampDate: TDateTime = 0; ATimeZoneOffset: Double = 0);
 
Public function GetGPSGMTStamp (out ALat: Double; out ALon: Double; out AAlt: Double; out AGPSStampDate: TDateTime): Boolean;
 
Public procedure RemoveExif;
 
Public procedure RemoveGPS;
 
Public function GEOForwardLookup (const ALocation: WideString; const ALanguage: String): Boolean;
 
Public function GEOReverseLookup (ALat, ALon: Double; const ALanguage: String): Boolean;
 
Public function GEOLookupAltitude (ALat, ALon: Double): Boolean;
 
Public function MapToIPTC (ATif: TTif): Boolean; overload;
 
Public function MapToIPTC (const AFileName: WideString): Boolean; overload;
 
Public function MapFromIPTC (ATif: TTif): Boolean; overload;
 
Public function MapFromIPTC (const AFileName: WideString): Boolean; overload;
 
Public function MapFromExif (ATif: TTif; ACheckXMP: Boolean = False): Boolean; overload;
 
Public function MapFromExif (const AFileName: WideString; ACheckXMP: Boolean = False): Boolean; overload;
 
Public function MapFromExifAndIPTC (ATif: TTif; ACheckXMP: Boolean = False): Boolean; overload;
 
Public function MapFromExifAndIPTC (const AFileName: WideString; ACheckXMP: Boolean = False): Boolean; overload;
 
Public procedure ImportParams (AParams: TMacroParams; AIsMappedParams: Boolean; AUpdateXml: Boolean = False; AOnlyFilled: Boolean = True; AMultiStates: Boolean = False; AUpdateEditStates: Boolean = True);
 
Public function QuickSetProperty (const ANamespace: WideString; const APropertyName: WideString; const AValue: Variant): TMacroParam;
 
Public function QuickGetProperty (const ANamespace: WideString; const APropertyName: WideString): Variant;
 
Public function QuickRemoveProperty (const ANamespace: WideString; const APropertyName: WideString): Boolean;
 
Public function FindProperty (AModel: TXMPModel; const ANamespace, ATag: WideString): TMacroParam;
 
Public function FindModelProperty (const ANamespace, ATag: WideString): TMacroParam;
 
Public function FindDesignProperty (const ANamespace, ATag: WideString): TMacroParam;
 
Public procedure Reset; virtual;
 
Public procedure DeleteRecipe;
 
Public function PhotoDate(AZulu: Boolean = False): TDateTime;
 
Public function PhotoDateOriginal: TDateTime;
 
Public function PhotoDateDigitized: TDateTime;
 
Public function PhotoDateDescription: TDateTime;
 
Public function Orientation: TTifOrientation;
 
Public function DimensionsXY(var AWidth, AHeight: Integer): WideString;
 
Public function Dimensions: WideString;
 
Public procedure UpdateDimensionsXY(AWidth, AHeight: Integer);
 
Public function Resolution: WideString;
 
Public function ShortExifString (const ASeparator: WideString = ' '; const AWithTitles: Boolean = False): WideString;
 
Public function ShorterExifString (const ASeparator: WideString = ' '; const AWithTitles: Boolean = False): WideString;
 

Properties

Public property FileName: WideString read FFileName write FFilename;
 
Public property XMPDesign: TXMPModel read FXMPDesign write FXMPDesign;
 
Public property XMLDocument: TXMLDocument read FXMLDocument;
 
Public property HasXMP: Boolean read GetHasXMP;
 
Public property HasGPS: Boolean read GetHasGPS;
 
Public property HasRecipe: Boolean read GetRecipe;
 
Public property Changed: Boolean read FChanged write FChanged;
 
Public property AutoCheckIPTC: Boolean read FAutoCheckIPTC write FAutoCheckIPTC;
 
Public property UpdateMetadataDate: Boolean read FUpdateMetadataDate write FUpdateMetadataDate;
 
Public property AdditiveArrayMode: Boolean read FAdditiveArrayMode write FAdditiveArrayMode;
 
Public property HashKey: AnsiString read GetHashKey;
 
Public property StoredHashKey: AnsiString read FStoredHashKey write FStoredHashKey;
 
Public property CleanRead: Boolean read FCleanRead write FCleanRead;

When using CleanRead and no XMP is available yet then the Exif/IPTC is not converted; by default it is

Public property _ConvertToXMPOnlyWhenNoTechnical: Boolean read F_ConvertToXMPOnlyWhenNoTechnical write F_ConvertToXMPOnlyWhenNoTechnical;
 
Published property Text: WideString read FText write FText;
 
Published property ReadUnknownSchemas: Boolean read FReadUnknownSchemas write FReadUnknownSchemas;
 
Published property Mapped: Boolean read FMapped write SetMapped;
 
Published property KeepHistory: Boolean read FKeepHistory write FKeepHistory;
 
Published property StorePreservedFileName: Boolean read FStorePreservedFileName write FStorePreservedFileName;
 

Generated by PasDoc 0.15.0.