/ccr-exif/CCR.Exif.pas
https://bitbucket.org/sas_team/sas.requires · Pascal · 7404 lines · 6459 code · 690 blank · 255 comment · 544 complexity · 4c8faa505b5c20b70482dd69f01ec26b MD5 · raw file
Large files are truncated click here to view the full file
- {**************************************************************************************}
- { }
- { CCR Exif - Delphi class library for reading and writing image metadata }
- { Version 1.5.3 }
- { }
- { The contents of this file are subject to the Mozilla Public License Version 1.1 }
- { (the "License"); you may not use this file except in compliance with the License. }
- { You may obtain a copy of the License at http://www.mozilla.org/MPL/ }
- { }
- { Software distributed under the License is distributed on an "AS IS" basis, WITHOUT }
- { WARRANTY OF ANY KIND, either express or implied. See the License for the specific }
- { language governing rights and limitations under the License. }
- { }
- { The Original Code is CCR.Exif.pas. }
- { }
- { The Initial Developer of the Original Code is Chris Rolliston. Portions created by }
- { Chris Rolliston are Copyright (C) 2009-2014 Chris Rolliston. All Rights Reserved. }
- { }
- {**************************************************************************************}
-
- {$I CCR.Exif.inc}
- unit CCR.Exif;
- {
- Notes:
- - In Exif-jargon, we have 'tags' and 'IFDs' (including 'sub-IFDs'). In the jargon of
- this unit, we have 'tags' and 'sections'.
- - The basic usage pattern is this: construct a TExifData instance; call LoadFromGraphic,
- which has file name, TStream and TGraphic/TBitmap overloads; read and write
- the published tag properties as you so wish; and call SaveToGraphic to persist the
- changes made. Supported graphic types are JPEG, PSD and TIFF. LoadFromGraphic (which
- is a function) returns True if the source was of a supported graphic type, False
- otherwise. In contrast, SaveToGraphic will simply raise an exception if the
- destination isn't of a supported type.
- - The idea is that, in general, if your sole concern is reading and/or writing Exif
- metadata, you only need to explicitly add CCR.Exif to your uses clause. This unit
- does still itself use the other ones (CCR.Exif.BaseUtils etc.) though.
- - You enumerate the tags of a section with the for-in syntax. No traditional indexing
- is provided so as to avoid confusing tag IDs with tag indices.
- - The enumerator implementation for TExifSection allows calling Delete on a tag while
- you are enumerating the container section.
- - When tags are loaded from a graphic, any associated XMP packet is loaded too, though
- XMP data is only actually parsed when required.
- - When setting a tag property, the default behaviour is for the loaded XMP packet
- to be updated if the equivalent XMP tag already exists. This can be changed however
- by setting the XMPWritePolicy property of TExifData.
- - Maker note rewriting is *not* supported in TExifData. While you can make changes to
- the loaded maker note tags, these changes won't ever be persisted.
- - When compiling in XE2+, you need to set a 'FMX' global define for this unit to work
- properly in a FireMonkey application.
- }
- interface
-
- uses
- Types, SysUtils, Classes, TypInfo, CCR.Exif.BaseUtils, CCR.Exif.IPTC,
- {$IFDEF HasGenerics}Generics.Collections, Generics.Defaults,{$ENDIF}
- {$IFDEF VCL}Graphics, Jpeg,{$ENDIF}
- {$IFDEF FMX}FMX.Types,{$IF CompilerVersion >= 26}FMX.Graphics, FMX.Surfaces,{$IFEND}{$ENDIF}
- CCR.Exif.StreamHelper, CCR.Exif.TagIDs, CCR.Exif.TiffUtils, CCR.Exif.XMPUtils;
-
- const
- SmallEndian = CCR.Exif.StreamHelper.SmallEndian;
- BigEndian = CCR.Exif.StreamHelper.BigEndian;
-
- xwAlwaysUpdate = CCR.Exif.XMPUtils.xwAlwaysUpdate;
- xwUpdateIfExists = CCR.Exif.XMPUtils.xwUpdateIfExists;
- xwRemove = CCR.Exif.XMPUtils.xwRemove;
-
- type
- EInvalidJPEGHeader = CCR.Exif.BaseUtils.EInvalidJPEGHeader;
- ECCRExifException = CCR.Exif.BaseUtils.ECCRExifException;
- EInvalidTiffData = CCR.Exif.TiffUtils.EInvalidTiffData;
-
- TEndianness = CCR.Exif.StreamHelper.TEndianness;
-
- const
- tdExifFraction = tdLongWordFraction;
- tdExifSignedFraction = tdLongIntFraction;
- leBadOffset = CCR.Exif.BaseUtils.leBadOffset;
- leBadTagCount = CCR.Exif.BaseUtils.leBadTagCount;
- leBadTagHeader = CCR.Exif.BaseUtils.leBadTagHeader;
-
- tdUndefined = CCR.Exif.TiffUtils.tdUndefined;
-
- StandardExifThumbnailWidth = 160;
- StandardExifThumbnailHeight = 120;
-
- type
- {$IFDEF FMX}
- TGraphic = TBitmap;
-
- TJPEGImage = class(TBitmap, IStreamPersist)
- public
- constructor Create; reintroduce;
- procedure SaveToStream(Stream: TStream);
- property Empty: Boolean read IsEmpty;
- end;
- {$ENDIF}
- {$IF NOT Declared(TJPEGImage)}
- {$DEFINE DummyTJpegImage}
- TJPEGImage = class(TInterfacedPersistent, IStreamPersist)
- strict private
- FData: TMemoryStream;
- FWidth, FHeight: Integer;
- FOnChange: TNotifyEvent;
- function GetWidth: Integer;
- function GetHeight: Integer;
- procedure SizeFieldsNeeded;
- protected
- procedure AssignTo(Dest: TPersistent); override;
- procedure Changed; virtual;
- function GetEmpty: Boolean;
- public
- constructor Create;
- destructor Destroy; override;
- procedure Assign(Source: TPersistent); override;
- procedure LoadFromStream(Stream: TStream);
- procedure SaveToStream(Stream: TStream);
- property Empty: Boolean read GetEmpty;
- property Width: Integer read GetWidth;
- property Height: Integer read GetHeight;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- end;
- {$IFEND}
-
- ENotOnlyASCIIError = class(EInvalidTiffData);
-
- TExifTag = class;
- TExifSection = class;
- TExtendableExifSection = class;
- TCustomExifData = class;
- TExifData = class;
-
- TExifTagID = TTiffTagID;
- TExifDataType = TTiffDataType;
- TExifDataTypes = TTiffDataTypes;
-
- PExifFraction = ^TExifFraction;
- TExifFraction = TTiffLongWordFraction;
- TExifSignedFraction = TTiffLongIntFraction;
- {$Z2}
- TWindowsStarRating = (urUndefined, urOneStar, urTwoStars, urThreeStars,
- urFourStars, urFiveStars);
- {$Z1}
- TExifTagChangeType = (tcData, tcDataSize, tcID);
- TExifPaddingTagSize = 2..High(LongInt);
-
- TExifTag = class(TNoRefCountInterfacedObject, IMetadataBlock, ITiffTag)
- strict private
- FAsStringCache: string;
- FData: Pointer;
- FDataStream: TUserMemoryStream;
- FDataType: TExifDataType;
- FElementCount: LongInt;
- FID: TExifTagID;
- FOriginalDataOffset: Int64;
- FOriginalDataSize: Integer;
- FWellFormed: Boolean;
- function GetAsString: string;
- procedure SetAsString(const Value: string);
- function GetDataSize: Integer; inline;
- procedure SetDataType(const NewDataType: TExifDataType);
- function GetElementAsString(Index: Integer): string;
- procedure SetElementCount(const NewCount: LongInt);
- procedure SetID(const Value: TExifTagID);
- protected
- { IMetadataBlock }
- function GetData: TCustomMemoryStream;
- function IsExifBlock(CheckID: Boolean = True): Boolean;
- function IsIPTCBlock(CheckID: Boolean = True): Boolean;
- function IsXMPBlock(CheckID: Boolean = True): Boolean;
- { ITiffTag }
- function GetDataType: TTiffDataType;
- function GetElementCount: Integer;
- function GetID: TTiffTagID;
- function GetOriginalDataOffset: LongWord;
- function GetParent: ITiffDirectory;
- protected
- {$IFDEF WEAKREF}[Weak]{$ENDIF}FSection: TExifSection;
- procedure Changing(NewID: TExifTagID; NewDataType: TExifDataType;
- NewElementCount: LongInt; NewData: Boolean);
- procedure Changed(ChangeType: TExifTagChangeType); overload;
- procedure WriteHeader(Stream: TStream; Endianness: TEndianness; DataOffset: LongInt);
- procedure WriteOffsettedData(Stream: TStream; Endianness: TEndianness);
- constructor Create(Section: TExifSection; const Directory: IFoundTiffDirectory;
- Index: Integer); overload;
- property DataStream: TUserMemoryStream read FDataStream;
- public
- constructor Create(const Section: TExifSection; const ID: TExifTagID;
- DataType: TExifDataType; ElementCount: LongInt); overload;
- destructor Destroy; override;
- procedure Assign(Source: TExifTag);
- procedure Changed; overload; //call this if Data is modified directly
- procedure Delete; inline;
- function HasWindowsStringData: Boolean;
- function IsPadding: Boolean;
- procedure SetAsPadding(Size: TExifPaddingTagSize);
- procedure UpdateData(NewDataType: TExifDataType; NewElementCount: LongInt;
- const NewData); overload;
- procedure UpdateData(const NewData); overload;
- function ReadFraction(Index: Integer; const Default: TExifFraction): TExifFraction;
- function ReadLongWord(Index: Integer; const Default: LongWord): LongWord;
- function ReadWord(Index: Integer; const Default: Word): Word;
- {$IFDEF HasToString}
- function ToString: string; override;
- {$ENDIF}
- property AsString: string read GetAsString write SetAsString;
- property ElementAsString[Index: Integer]: string read GetElementAsString;
- property Data: Pointer read FData;
- property DataSize: Integer read GetDataSize;
- property DataType: TExifDataType read FDataType write SetDataType; //this needs to be loaded before AsString
- property ElementCount: LongInt read FElementCount write SetElementCount;
- property ID: TExifTagID read FID write SetID;
- property OriginalDataOffset: Int64 read FOriginalDataOffset;
- property OriginalDataSize: Integer read FOriginalDataSize;
- property Section: TExifSection read FSection;
- property WellFormed: Boolean read FWellFormed;
- end;
-
- TExifSectionLoadError = TMetadataLoadError;
- TExifSectionLoadErrors = TMetadataLoadErrors;
-
- TExifSectionKindEx = (esUserDefined, esGeneral, esDetails, esInterop, esGPS,
- esThumbnail, esMakerNote);
- TExifSectionKind = esGeneral..esMakerNote;
-
- TExifSection = class(TNoRefCountInterfacedObject, ITiffDirectory)
- private type
- {$IFDEF HasGenerics}
- TTagList = class(TList<TExifTag>)
- constructor Create;
- end;
- {$ELSE}
- TTagList = class(TList)
- public
- procedure Sort;
- end;
- {$ENDIF}
- public type
- TEnumerator = class sealed(TInterfacedObject, ITiffDirectoryEnumerator)
- private
- FCurrent: TExifTag;
- FIndex: Integer;
- FTags: TTagList;
- constructor Create(ATagList: TTagList);
- function GetCurrent: ITiffTag;
- public
- function MoveNext: Boolean;
- property Current: TExifTag read FCurrent;
- end;
- strict private class var
- LastSetDateTimeValue: TDateTime;
- LastSetDateTimeMainStr, LastSetDateTimeSubSecStr: string;
- strict private
- FFirstTagHeaderOffset: Int64;
- FKind: TExifSectionKindEx;
- FLoadErrors: TExifSectionLoadErrors;
- FModified: Boolean;
- {$IFDEF WEAKREF}[Weak]{$ENDIF}FOwner: TCustomExifData;
- FTagList: TTagList;
- procedure DoSetFractionValue(TagID: TExifTagID; Index: Integer;
- DataType: TExifDataType; const Value);
- protected
- { ITiffDirectory }
- function FindTag(TagID: TTiffTagID; out ParsedTag: ITiffTag): Boolean;
- function GetEnumeratorIntf: ITiffDirectoryEnumerator;
- function ITiffDirectory.GetEnumerator = GetEnumeratorIntf;
- function GetIndex: Integer;
- function GetParent: ITiffDirectory;
- function GetTagCount: Integer;
- function LoadSubDirectory(OffsetTagID: TTiffTagID): ITiffDirectory;
- { other }
- constructor Create(const AOwner: TCustomExifData; AKind: TExifSectionKindEx);
- function Add(ID: TExifTagID; DataType: TExifDataType; ElementCount: LongInt): TExifTag;
- procedure Changed;
- function CheckExtendable: TExtendableExifSection;
- procedure DoDelete(TagIndex: Integer; FreeTag: Boolean);
- function EnforceASCII: Boolean;
- function FindIndex(ID: TExifTagID; var TagIndex: Integer): Boolean;
- function ForceSetElement(ID: TExifTagID; DataType: TExifDataType;
- Index: Integer; const Value): TExifTag;
- procedure Load(const Directory: IFoundTiffDirectory; TiffImageSource: Boolean);
- procedure TagChanging(Tag: TExifTag; NewID: TExifTagID;
- NewDataType: TExifDataType; NewElementCount: LongInt; NewData: Boolean);
- procedure TagChanged(Tag: TExifTag; ChangeType: TExifTagChangeType);
- procedure TagDeleting(Tag: TExifTag);
- property FirstTagHeaderOffset: Int64 read FFirstTagHeaderOffset;
- public
- destructor Destroy; override;
- function GetEnumerator: TEnumerator;
- procedure Clear;
- function Find(ID: TExifTagID; out Tag: TExifTag): Boolean;
- function GetByteValue(TagID: TExifTagID; Index: Integer; Default: Byte;
- MinValue: Byte = 0; MaxValue: Byte = High(Byte)): Byte;
- function GetDateTimeValue(MainID, SubSecsID: TExifTagID): TDateTimeTagValue;
- function GetFractionValue(TagID: TExifTagID; Index: Integer): TExifFraction; overload;
- function GetFractionValue(TagID: TExifTagID; Index: Integer;
- const Default: TExifFraction): TExifFraction; overload;
- function GetLongIntValue(TagID: TExifTagID; Index: Integer): TLongIntTagValue; overload;
- function GetLongIntValue(TagID: TExifTagID; Index: Integer; Default: LongInt): LongInt; overload;
- function GetLongWordValue(TagID: TExifTagID; Index: Integer): TLongWordTagValue; overload;
- function GetLongWordValue(TagID: TExifTagID; Index: Integer; Default: LongWord): LongWord; overload;
- function GetSmallIntValue(TagID: TExifTagID; Index: Integer; Default: SmallInt;
- MinValue: SmallInt = Low(SmallInt); MaxValue: SmallInt = High(SmallInt)): SmallInt;
- function GetStringValue(TagID: TExifTagID; const Default: string = ''): string;
- function GetWindowsStringValue(TagID: TExifTagID; const Default: UnicodeString = ''): UnicodeString;
- function GetWordValue(TagID: TExifTagID; Index: Integer): TWordTagValue; overload;
- function GetWordValue(TagID: TExifTagID; Index: Integer; Default: Word;
- MinValue: Word = 0; MaxValue: Word = High(Word)): Word; overload;
- function IsExtendable: Boolean; inline;
- function Remove(ID: TExifTagID): Boolean; overload; //returns True if contained a tag with the specified ID
- procedure Remove(const IDs: array of TExifTagID); overload;
- function RemovePaddingTag: Boolean; //returns True if contained a padding tag
- function SetByteValue(TagID: TExifTagID; Index: Integer; Value: Byte): TExifTag;
- procedure SetDateTimeValue(MainID, SubSecsID: TExifTagID; const DateTime: TDateTimeTagValue);
- procedure SetFractionValue(TagID: TExifTagID; Index: Integer; const Value: TExifFraction);
- function SetLongWordValue(TagID: TExifTagID; Index: Integer; Value: LongWord): TExifTag;
- procedure SetSignedFractionValue(TagID: TExifTagID; Index: Integer;
- const Value: TExifSignedFraction);
- procedure SetStringValue(TagID: TExifTagID; const Value: string);
- procedure SetWindowsStringValue(TagID: TExifTagID; const Value: UnicodeString);
- function SetWordValue(TagID: TExifTagID; Index: Integer; Value: Word): TExifTag;
- function TagExists(ID: TExifTagID; ValidDataTypes: TExifDataTypes =
- [Low(TExifDataType)..High(TExifDataType)]; MinElementCount: LongInt = 1;
- MaxElementCount: LongInt = MaxLongInt): Boolean;
- function TryGetByteValue(TagID: TExifTagID; Index: Integer; var Value): Boolean;
- function TryGetLongWordValue(TagID: TExifTagID; Index: Integer; var Value): Boolean;
- function TryGetWordValue(TagID: TExifTagID; Index: Integer; var Value): Boolean;
- function TryGetStringValue(TagID: TExifTagID; var Value: string): Boolean;
- function TryGetWindowsStringValue(TagID: TExifTagID; var Value: UnicodeString): Boolean;
- property Count: Integer read GetTagCount;
- property Kind: TExifSectionKindEx read FKind;
- property LoadErrors: TExifSectionLoadErrors read FLoadErrors write FLoadErrors;
- property Modified: Boolean read FModified write FModified;
- property Owner: TCustomExifData read FOwner;
- end;
-
- TExifSectionClass = class of TExifSection;
-
- TExtendableExifSection = class(TExifSection)
- public
- function Add(ID: TExifTagID; DataType: TExifDataType;
- ElementCount: LongInt = 1): TExifTag;
- function AddOrUpdate(ID: TExifTagID; DataType: TExifDataType;
- ElementCount: LongInt): TExifTag; overload;
- function AddOrUpdate(ID: TExifTagID; DataType: TExifDataType;
- ElementCount: LongInt; const Data): TExifTag; overload;
- function AddOrUpdate(ID: TExifTagID; DataType: TExifDataType;
- const Source: IStreamPersist): TExifTag; overload;
- procedure Assign(Source: TExifSection);
- procedure CopyTags(Section: TExifSection);
- end;
-
- EInvalidMakerNoteFormat = class(EInvalidTiffData);
-
- TObjectTagValue = class(TInterfacedPersistent)
- strict private
- {$IFDEF WEAKREF}[Weak]{$ENDIF}FOwner: TCustomExifData;
- protected
- constructor Create(const AOwner: TCustomExifData);
- function GetOwner: TPersistent; override;
- property Owner: TCustomExifData read FOwner;
- public
- function MissingOrInvalid: Boolean; virtual; abstract;
- {$IFNDEF HasToString}
- function ToString: string; virtual;
- {$ENDIF}
- end;
-
- IEnumToCharMapper = interface
- ['{B068C720-1832-4A3F-97F1-0321809EC33B}']
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- property EnumTypeInfo: PTypeInfo read GetEnumTypeInfo;
- end;
-
- IEnumToCharMapperEx = interface(IEnumToCharMapper)
- ['{7911A192-BEA4-42A8-B1A7-EB5749972FB0}']
- function GetEnumName(OrdValue: Integer): string;
- function GetMinEnumValue: Integer;
- function GetMaxEnumValue: Integer;
- property MinEnumValue: Integer read GetMinEnumValue;
- property MaxEnumValue: Integer read GetMaxEnumValue;
- end;
-
- TEnumObjectTagValue = class(TObjectTagValue)
- strict private
- FValidCharsToAssign: TSysCharSet;
- function GetValidCharsToAssign: TSysCharSet;
- protected
- property ValidCharsToAssign: TSysCharSet read GetValidCharsToAssign;
- end;
-
- TExifFlashMode = (efUnknown, efCompulsoryFire, efCompulsorySuppression, efAuto);
- TExifStrobeLight = (esNoDetectionFunction, esUndetected, esDetected);
-
- TWordBitEnum = 0..SizeOf(Word) * 8 - 1;
- TWordBitSet = set of TWordBitEnum;
-
- TExifFlashInfo = class(TObjectTagValue)
- strict private const
- FiredBit = 0;
- NotPresentBit = 5;
- RedEyeReductionBit = 6;
- strict private
- function GetBitSet: TWordBitSet;
- procedure SetBitSet(const Value: TWordBitSet);
- function GetFired: Boolean;
- procedure SetFired(Value: Boolean);
- function GetMode: TExifFlashMode;
- procedure SetMode(const Value: TExifFlashMode);
- function GetPresent: Boolean;
- procedure SetPresent(Value: Boolean);
- function GetRedEyeReduction: Boolean;
- procedure SetRedEyeReduction(Value: Boolean);
- function GetStrobeEnergy: TExifFraction;
- procedure SetStrobeEnergy(const Value: TExifFraction);
- function GetStrobeLight: TExifStrobeLight;
- procedure SetStrobeLight(const Value: TExifStrobeLight);
- public
- procedure Assign(Source: TPersistent); override;
- function MissingOrInvalid: Boolean; override;
- property BitSet: TWordBitSet read GetBitSet write SetBitSet stored False;
- published
- property Fired: Boolean read GetFired write SetFired stored False;
- property Mode: TExifFlashMode read GetMode write SetMode stored False;
- property Present: Boolean read GetPresent write SetPresent stored False;
- property RedEyeReduction: Boolean read GetRedEyeReduction write SetRedEyeReduction stored False;
- property StrobeEnergy: TExifFraction read GetStrobeEnergy write SetStrobeEnergy stored False;
- property StrobeLight: TExifStrobeLight read GetStrobeLight write SetStrobeLight stored False;
- end;
-
- TExifVersionElement = 0..9;
-
- TCustomExifVersion = class abstract(TObjectTagValue)
- strict private
- function GetAsString: string;
- procedure SetAsString(const Value: string);
- function GetMajor: TExifVersionElement;
- procedure SetMajor(Value: TExifVersionElement);
- function GetMinor: TExifVersionElement;
- procedure SetMinor(Value: TExifVersionElement);
- function GetRelease: TExifVersionElement;
- procedure SetRelease(Value: TExifVersionElement);
- protected
- FMajorIndex: Integer;
- FSectionKind: TExifSectionKind;
- FStoreAsChar: Boolean;
- FTagID: TExifTagID;
- FTiffDataType: TTiffDataType;
- constructor Create(const AOwner: TCustomExifData);
- procedure Initialize; virtual; abstract;
- function GetValue(Index: Integer): TExifVersionElement; virtual;
- procedure SetValue(Index: Integer; Value: TExifVersionElement); virtual;
- public
- procedure Assign(Source: TPersistent); override;
- procedure Clear; virtual;
- function MissingOrInvalid: Boolean; override;
- function ToString: string; override;
- property AsString: string read GetAsString write SetAsString;
- published
- property Major: TExifVersionElement read GetMajor write SetMajor stored False;
- property Minor: TExifVersionElement read GetMinor write SetMinor stored False;
- property Release: TExifVersionElement read GetRelease write SetRelease stored False;
- end;
-
- TExifVersion = class(TCustomExifVersion)
- strict private
- FValues: array[1..3] of TExifVersionElement;
- protected
- procedure Initialize; override;
- function GetValue(Index: Integer): TExifVersionElement; override;
- procedure SetValue(Index: Integer; Value: TExifVersionElement); override;
- public
- constructor Create(const AOwner: TCustomExifData); overload;
- constructor Create; overload;
- procedure Clear; override;
- end;
-
- TFlashPixVersion = class(TCustomExifVersion)
- protected
- procedure Initialize; override;
- end;
-
- TGPSVersion = class(TCustomExifVersion)
- protected
- procedure Initialize; override;
- end;
-
- TInteropVersion = class(TCustomExifVersion)
- protected
- procedure Initialize; override;
- end;
-
- {$Z2}
- TTiffOrientation = (toUndefined, toTopLeft, toTopRight, toBottomRight,
- toBottomLeft, toLeftTop{i.e., rotated}, toRightTop, toRightBottom, toLeftBottom);
- TExifOrientation = TTiffOrientation;
- TTiffResolutionUnit = (trNone = 1, trInch, trCentimetre);
- TExifResolutionUnit = TTiffResolutionUnit;
-
- TExifColorSpace = (csTagMissing = 0, csRGB = 1, csAdobeRGB = 2, csWideGamutRGB = $FFFD,
- csICCProfile = $FFFE, csUncalibrated = $FFFF);
- TExifContrast = (cnTagMissing = -1, cnNormal, cnSoft, cnHard);
- TExifExposureMode = (exTagMissing = -1, exAuto, exManual, exAutoBracket);
- TExifExposureProgram = (eeTagMissing = -1, eeUndefined, eeManual, eeNormal,
- eeAperturePriority, eeShutterPriority, eeCreative, eeAction, eePortrait, eeLandscape);
- TExifGainControl = (egTagMissing = -1, egNone, egLowGainUp, egHighGainUp, egLowGainDown, egHighGainDown);
- TExifLightSource = (elTagMissing = -1, elUnknown, elDaylight, elFluorescent,
- elTungsten, elFlash, elFineWeather = 9, elCloudyWeather, elShade, elDaylightFluorescent,
- elDayWhiteFluorescent, elCoolWhiteFluorescent, elWhiteFluorescent,
- elStandardLightA = 17, elStandardLightB, elStandardLightC, elD55, elD65,
- elD75, elD50, elISOStudioTungsten, elOther = 255);
- TExifMeteringMode = (emTagMissing = -1, emUnknown, emAverage, emCenterWeightedAverage,
- emSpot, emMultiSpot, emPattern, emPartial);
- TExifRendering = (erTagMissing = -1, erNormal, erCustom);
- TExifSaturation = (euTagMissing = -1, euNormal, euLow, euHigh);
- TExifSceneCaptureType = (ecTagMissing = -1, ecStandard, ecLandscape, ecPortrait, ecNightScene);
- TExifSensingMethod = (esTagMissing = -1, esMonochrome = 1, esOneChip, esTwoChip,
- esThreeChip, esColorSequential, esTrilinear = 7, esColorSequentialLinear); //esMonochrome was esUndefined before 0.9.7
- TExifSharpness = (ehTagMissing = -1, ehNormal, ehSoft, ehHard);
- TExifSubjectDistanceRange = (edTagMissing = -1, edUnknown, edMacro, edClose, edDistant);
- TExifWhiteBalanceMode = (ewTagMissing = -1, ewAuto, ewManual);
- {$Z1}
-
- TCustomExifResolution = class(TObjectTagValue)
- strict private
- FSchema: TXMPNamespace;
- FSection: TExifSection;
- FXTagID, FYTagID, FUnitTagID: TExifTagID;
- FXName, FYName, FUnitName: UnicodeString;
- protected
- function GetUnit: TExifResolutionUnit; virtual;
- function GetX: TExifFraction; virtual;
- function GetY: TExifFraction; virtual;
- procedure SetUnit(const Value: TExifResolutionUnit); virtual;
- procedure SetX(const Value: TExifFraction); virtual;
- procedure SetY(const Value: TExifFraction); virtual;
- procedure GetTagInfo(var Section: TExifSectionKind;
- var XTag, YTag, UnitTag: TExifTagID; var Schema: TXMPNamespace;
- var XName, YName, UnitName: UnicodeString); virtual; abstract;
- public
- constructor Create(const AOwner: TCustomExifData);
- procedure Assign(Source: TPersistent); override;
- function MissingOrInvalid: Boolean; override;
- function ToString: string; override;
- property Section: TExifSection read FSection;
- published
- property X: TExifFraction read GetX write SetX stored False;
- property Y: TExifFraction read GetY write SetY stored False;
- property Units: TExifResolutionUnit read GetUnit write SetUnit stored False;
- end;
-
- TExifResolution = class(TCustomExifResolution) //standalone
- strict private
- FX, FY: TExifFraction;
- FUnit: TExifResolutionUnit;
- protected
- function GetUnit: TExifResolutionUnit; override;
- function GetX: TExifFraction; override;
- function GetY: TExifFraction; override;
- procedure SetUnit(const Value: TExifResolutionUnit); override;
- procedure SetX(const Value: TExifFraction); override;
- procedure SetY(const Value: TExifFraction); override;
- procedure GetTagInfo(var Section: TExifSectionKind;
- var XTag, YTag, UnitTag: TExifTagID; var Schema: TXMPNamespace;
- var XName, YName, UnitName: UnicodeString); override;
- public
- constructor Create;
- procedure Assign(Source: TPersistent); override;
- function MissingOrInvalid: Boolean; override;
- end;
-
- TImageResolution = class(TCustomExifResolution)
- protected
- procedure GetTagInfo(var Section: TExifSectionKind;
- var XTag, YTag, UnitTag: TExifTagID; var Schema: TXMPNamespace;
- var XName, YName, UnitName: UnicodeString); override;
- end;
-
- TFocalPlaneResolution = class(TCustomExifResolution)
- protected
- procedure GetTagInfo(var Section: TExifSectionKind;
- var XTag, YTag, UnitTag: TExifTagID; var Schema: TXMPNamespace;
- var XName, YName, UnitName: UnicodeString); override;
- end;
-
- TThumbnailResolution = class(TCustomExifResolution)
- protected
- procedure GetTagInfo(var Section: TExifSectionKind;
- var XTag, YTag, UnitTag: TExifTagID; var Schema: TXMPNamespace;
- var XName, YName, UnitName: UnicodeString); override;
- end;
-
- TISOSpeedRatings = class(TObjectTagValue)
- strict private const
- XMPSchema = xsExif;
- XMPKind = xpSeqArray;
- XMPName = UnicodeString('ISOSpeedRatings');
- strict private
- function GetAsString: string;
- procedure SetAsString(const Value: string);
- function GetCount: Integer;
- function GetItem(Index: Integer): Word;
- procedure SetCount(const Value: Integer);
- procedure SetItem(Index: Integer; const Value: Word);
- protected
- procedure Clear;
- function FindTag(VerifyDataType: Boolean; out Tag: TExifTag): Boolean;
- public
- procedure Assign(Source: TPersistent); override;
- function MissingOrInvalid: Boolean; override;
- function ToString: string; override;
- property Items[Index: Integer]: Word read GetItem write SetItem; default;
- published
- property AsString: string read GetAsString write SetAsString stored False;
- property Count: Integer read GetCount write SetCount stored False;
- end;
-
- TExifFileSource = (fsUnknown, fsFilmScanner, fsReflectionPrintScanner, fsDigitalCamera);
- TExifSceneType = (esUnknown, esDirectlyPhotographed);
-
- TGPSLatitudeRef = (ltMissingOrInvalid, ltNorth, ltSouth);
- TGPSLongitudeRef = (lnMissingOrInvalid, lnWest, lnEast);
- TGPSAltitudeRef = (alTagMissing = -1, alAboveSeaLevel, alBelowSeaLevel); //!!!corrected v1.5.2
- TGPSStatus = (stMissingOrInvalid, stMeasurementActive, stMeasurementVoid);
- TGPSMeasureMode = (mmUnknown, mm2D, mm3D);
- TGPSSpeedRef = (srMissingOrInvalid, srKilometresPerHour, srMilesPerHour, srKnots); //Exif spec makes KM/h the default value
- TGPSDirectionRef = (drMissingOrInvalid, drTrueNorth, drMagneticNorth);
- TGPSDistanceRef = (dsMissingOrInvalid, dsKilometres, dsMiles, dsKnots);
- {$Z2}
- TGPSDifferential = (dfTagMissing = -1, dfWithoutCorrection, dfCorrectionApplied);
- {$Z1}
-
- TCustomGPSFraction = class(TEnumObjectTagValue)
- strict private
- FMainTagID, FRefTagID: TExifTagID;
- function GetDenominator: LongWord;
- function GetNumerator: LongWord;
- function GetQuotient: Extended;
- protected
- constructor Create(const AOwner: TCustomExifData;
- AMainTagID, ARefTagID: TExifTagID); overload;
- function GetValue: TExifFraction; virtual;
- procedure SetValue(const Value: TExifFraction); virtual;
- function GetRefChar: AnsiChar; virtual;
- procedure SetRefChar(const Value: AnsiChar); virtual;
- property MainTagID: TExifTagID read FMainTagID;
- property RefTagID: TExifTagID read FRefTagID;
- public
- procedure Assign(Source: TPersistent); override;
- function MissingOrInvalid: Boolean; override;
- function ToString: string; override;
- property Numerator: LongWord read GetNumerator;
- property Denominator: LongWord read GetDenominator;
- property Quotient: Extended read GetQuotient;
- property Ref: AnsiChar read GetRefChar write SetRefChar;
- property Value: TExifFraction read GetValue write SetValue;
- end;
-
- TGPSFraction = class(TCustomGPSFraction) //standalone
- strict private
- FRefChar: AnsiChar;
- FValue: TExifFraction;
- protected
- function GetValue: TExifFraction; override;
- procedure SetValue(const NewValue: TExifFraction); override;
- function GetRefChar: AnsiChar; override;
- procedure SetRefChar(const Value: AnsiChar); override;
- public
- constructor Create;
- end;
-
- TGPSAltitude = class(TCustomGPSFraction, IEnumToCharMapper, IEnumToCharMapperEx)
- strict private
- function GetRef: TGPSAltitudeRef;
- procedure SetRef(const Value: TGPSAltitudeRef);
- protected
- function GetRefChar: AnsiChar; override;
- procedure SetRefChar(const Value: AnsiChar); override;
- { IEnumToCharMapper/Ex - no RTTI, so need to provide min and max ordinal values explicitly }
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- function GetMinEnumValue: Integer;
- function GetMaxEnumValue: Integer;
- function GetEnumName(OrdValue: Integer): string;
- public
- function ToString: string; override;
- property Ref: TGPSAltitudeRef read GetRef write SetRef;
- end;
-
- TGPSSpeed = class(TCustomGPSFraction, IEnumToCharMapper)
- strict private
- function GetRef: TGPSSpeedRef; inline;
- procedure SetRef(const Value: TGPSSpeedRef); inline;
- protected
- { IEnumToCharMapper }
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- public
- function ToString: string; override;
- property Ref: TGPSSpeedRef read GetRef write SetRef;
- end;
-
- TCustomGPSFractionWithDirection = class(TCustomGPSFraction, IEnumToCharMapper)
- strict private
- function GetRef: TGPSDirectionRef; inline;
- procedure SetRef(const Value: TGPSDirectionRef); inline;
- protected
- { IEnumToCharMapper }
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- public
- function ToString: string; override;
- property Ref: TGPSDirectionRef read GetRef write SetRef;
- end;
-
- TGPSTrack = class(TCustomGPSFractionWithDirection)
- end;
-
- TGPSImgDirection = class(TCustomGPSFractionWithDirection)
- end;
-
- TGPSDestBearing = class(TCustomGPSFractionWithDirection)
- end;
-
- TGPSDestDistance = class(TCustomGPSFraction, IEnumToCharMapper)
- strict private
- function GetRef: TGPSDistanceRef; inline;
- procedure SetRef(const Value: TGPSDistanceRef); inline;
- protected
- { IEnumToCharMapper }
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- public
- function ToString: string; override;
- property Ref: TGPSDistanceRef read GetRef write SetRef;
- end;
-
- TCustomGPSCoordinate = class(TEnumObjectTagValue)
- strict private
- FRefTagID, FTagID: TExifTagID;
- FXMPName: UnicodeString;
- procedure AssignCoordinate(Source: TCustomGPSCoordinate);
- protected
- constructor Create(const AOwner: TCustomExifData; const ATagID: TExifTagID); overload;
- procedure Assign(const ADegrees, AMinutes, ASeconds: TExifFraction;
- ADirectionChar: AnsiChar); reintroduce; overload; virtual;
- function GetDirectionChar: AnsiChar; virtual;
- function GetValue(Index: Integer): TExifFraction; virtual;
- procedure SetDirectionChar(NewChar: AnsiChar); virtual;
- function TryGetTag(out Tag: TExifTag): Boolean;
- property RefTagID: TExifTagID read FRefTagID;
- property TagID: TExifTagID read FTagID;
- property XMPName: UnicodeString read FXMPName;
- public
- procedure Assign(Source: TPersistent); overload; override;
- function MissingOrInvalid: Boolean; override;
- function ToString: string; override;
- property Degrees: TExifFraction index 0 read GetValue;
- property Minutes: TExifFraction index 1 read GetValue;
- property Seconds: TExifFraction index 2 read GetValue;
- property Direction: AnsiChar read GetDirectionChar write SetDirectionChar; //not DirectionChar so that it gets hidden by properly typed version in descendant classes
- published
- property AsString: string read ToString;
- end;
-
- TGPSCoordinate = class(TCustomGPSCoordinate) //standalone
- strict private
- FDirectionChar: AnsiChar;
- FValues: array[0..2] of TExifFraction;
- protected
- procedure AssignTo(Dest: TPersistent); override;
- function GetDirectionChar: AnsiChar; override;
- function GetValue(Index: Integer): TExifFraction; override;
- procedure SetDirectionChar(NewChar: AnsiChar); override;
- public
- constructor Create;
- procedure Assign(const ADegrees, AMinutes, ASeconds: TExifFraction;
- ADirectionChar: AnsiChar); override;
- property Degrees write FValues[0];
- property Minutes write FValues[1];
- property Seconds write FValues[2];
- end;
-
- TGPSLatitude = class(TCustomGPSCoordinate, IEnumToCharMapper)
- strict private
- function GetDirection: TGPSLatitudeRef; inline;
- protected
- { IEnumToCharMapper }
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- public
- procedure Assign(const ADegrees, AMinutes, ASeconds: TExifFraction;
- ADirection: TGPSLatitudeRef); reintroduce; overload;
- procedure Assign(ADegrees, AMinutes: LongWord; const ASeconds: TExifFraction;
- ADirection: TGPSLatitudeRef); reintroduce; overload; inline;
- procedure Assign(ADegrees, AMinutes: LongWord; const ASeconds: Currency;
- ADirection: TGPSLatitudeRef); reintroduce; overload; inline;
- procedure Assign(ADegrees, AMinutes, ASeconds: LongWord;
- ADirection: TGPSLatitudeRef); reintroduce; overload; inline;
- property Direction: TGPSLatitudeRef read GetDirection;
- end;
-
- TGPSLongitude = class(TCustomGPSCoordinate, IEnumToCharMapper)
- strict private
- function GetDirection: TGPSLongitudeRef; inline;
- protected
- { IEnumToCharMapper }
- function EnumValueToChar(OrdValue: Integer): AnsiChar;
- function CharToEnumValue(Ch: AnsiChar): Integer;
- function GetEnumTypeInfo: PTypeInfo;
- public
- procedure Assign(const ADegrees, AMinutes, ASeconds: TExifFraction;
- ADirection: TGPSLongitudeRef); reintroduce; overload;
- procedure Assign(ADegrees, AMinutes: LongWord; const ASeconds: TExifFraction;
- ADirection: TGPSLongitudeRef); reintroduce; overload; inline;
- procedure Assign(ADegrees, AMinutes: LongWord; const ASeconds: Currency;
- ADirection: TGPSLongitudeRef); reintroduce; overload; inline;
- procedure Assign(ADegrees, AMinutes, ASeconds: LongWord;
- ADirection: TGPSLongitudeRef); reintroduce; overload; inline;
- property Direction: TGPSLongitudeRef read GetDirection;
- end;
-
- { To add support for a different MakerNote format, you need to write a descendent of
- TExifMakerNote, implementing the protected version of FormatIsOK and probably
- GetIFDInfo too, before registering it via TExifData.RegisterMakerNoteType. }
-
- TExifDataOffsetsType = (doFromExifStart, doFromMakerNoteStart, doFromIFDStart,
- doCustomFormat); //!!!added doCustomFormat v1.5.0
-
- TExifMakerNote = class abstract
- strict private
- FDataOffsetsType: TExifDataOffsetsType;
- FEndianness: TEndianness;
- FTags: TExifSection;
- protected
- class function FormatIsOK(SourceTag: TExifTag;
- out HeaderSize: Integer): Boolean; overload; virtual; abstract;
- procedure GetIFDInfo(SourceTag: TExifTag; var ProbableEndianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); virtual;
- function GetFractionValue(TagID: Integer): TExifFraction;
- function GetTagAsString(TagID: Integer): string;
- //procedure RewriteSourceTag(Tag: TExifTag); virtual;
- //procedure WriteHeader(Stream: TStream); virtual; abstract;
- //procedure SaveToStream(Stream: TStream; const StartPos: Int64);
- public
- constructor Create(ASection: TExifSection);
- class function FormatIsOK(SourceTag: TExifTag): Boolean; overload;
- property DataOffsetsType: TExifDataOffsetsType read FDataOffsetsType;
- property Endianness: TEndianness read FEndianness;
- property Tags: TExifSection read FTags;
- end;
-
- TExifMakerNoteClass = class of TExifMakerNote;
-
- TUnrecognizedMakerNote = class sealed(TExifMakerNote)
- protected
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- THeaderlessMakerNote = class(TExifMakerNote) //special type tried as a last resort; also serves as a
- protected //nominal base class for a few of the concrete implementations
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TAppleMakerNote = class(TExifMakerNote)
- protected
- const Header: array[0..13] of AnsiChar = 'Apple iOS'#0#0#1'MM';
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- procedure GetIFDInfo(SourceTag: TExifTag; var ProbableEndianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); override;
- end;
-
- TCanonMakerNote = class(THeaderlessMakerNote)
- protected
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- procedure GetIFDInfo(SourceTag: TExifTag; var ProbableEndianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); override;
- end;
-
- TCasioMakerNote = class(THeaderlessMakerNote)
- protected
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TCasio2MakerNote = class(TExifMakerNote)
- protected
- const Header: array[0..5] of AnsiChar = 'QVC';
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TKodakMakerNote = class(TExifMakerNote) //!!!work in very early progress
- public type
- TTagSpec = record
- DataType: TTiffDataType;
- ElementCount: Byte;
- constructor Create(ADataType: TTiffDataType; AElementCount: Byte = 1);
- end;
- class var TagSpecs: array of TTagSpec;
- class procedure InitializeTagSpecs; static;
- protected
- const HeaderSize = 8;
- const BigEndianHeader: array[0..HeaderSize - 1] of AnsiChar = 'KDK INFO';
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- procedure GetIFDInfo(SourceTag: TExifTag; var Endianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); override;
- end experimental;
-
- TKonicaMinoltaMakerNote = class(THeaderlessMakerNote)
- protected
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TPanasonicMakerNote = class(TExifMakerNote)
- protected
- const Header: array[0..11] of AnsiChar = 'Panasonic';
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- procedure GetIFDInfo(SourceTag: TExifTag; var ProbableEndianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); override;
- end;
-
- TPentaxMakerNote = class(TExifMakerNote) //won't actually parse the structure, just identify it
- protected
- const Header: array[0..3] of AnsiChar = 'AOC'#0;
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TNikonType1MakerNote = class(TExifMakerNote)
- protected
- const Header: array[0..7] of AnsiChar = 'Nikon'#0#1#0;
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TNikonType2MakerNote = class(THeaderlessMakerNote)
- protected
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- end;
-
- TNikonType3MakerNote = class(TExifMakerNote)
- protected
- const HeaderStart: array[0..6] of AnsiChar = 'Nikon'#0#2;
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- procedure GetIFDInfo(SourceTag: TExifTag; var ProbableEndianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); override;
- public
- property ColorMode: string index ttNikonType3ColorMode read GetTagAsString;
- property Quality: string index ttNikonType3Quality read GetTagAsString;
- property WhiteBalance: string index ttNikonType3WhiteBalance read GetTagAsString;
- property Sharpening: string index ttNikonType3Sharpening read GetTagAsString;
- property FocusMode: string index ttNikonType3FocusMode read GetTagAsString;
- property FlashSetting: string index ttNikonType3FlashSetting read GetTagAsString;
- property AutoFlashMode: string index ttNikonType3AutoFlashMode read GetTagAsString;
- property MiscRatio: TExifFraction index ttNikonType3MiscRatio read GetFractionValue;
- property ISOSelection: string index ttNikonType3ISOSelection read GetTagAsString;
- property AutoExposureBracketComp: TExifFraction index ttNikonType3AutoExposureBracketComp read GetFractionValue;
- property SerialNumber: string index ttNikonType3SerialNumber read GetTagAsString;
- property ImageAdjustment: string index ttNikonType3ImageAdjustment read GetTagAsString;
- property ToneComp: string index ttNikonType3ToneComp read GetTagAsString;
- property AuxiliaryLens: string index ttNikonType3AuxiliaryLens read GetTagAsString;
- property DigitalZoom: TExifFraction index ttNikonType3DigitalZoom read GetFractionValue;
- property SceneMode: string index ttNikonType3SceneMode read GetTagAsString;
- property LightSource: string index ttNikonType3LightSource read GetTagAsString;
- property NoiseReduction: string index ttNikonType3NoiseReduction read GetTagAsString;
- property SceneAssist: string index ttNikonType3SceneAssist read GetTagAsString;
- property CameraSerialNumber: string index ttNikonType3CameraSerialNumber read GetTagAsString;
- property Saturation: string index ttNikonType3Saturation read GetTagAsString;
- property DigitalVarProgram: string index ttNikonType3DigitalVarProg read GetTagAsString;
- property ImageStabilization: string index ttNikonType3ImageStabilization read GetTagAsString;
- property AFResponse: string index ttNikonType3AFResponse read GetTagAsString;
- property CaptureVersion: string index ttNikonType3CaptureVersion read GetTagAsString;
- end;
-
- TSonyMakerNote = class(TExifMakerNote)
- protected
- const Header: array[0..7] of AnsiChar = 'SONY DSC';
- class function FormatIsOK(SourceTag: TExifTag; out HeaderSize: Integer): Boolean; override;
- procedure GetIFDInfo(SourceTag: TExifTag; var ProbableEndianness: TEndianness;
- var DataOffsetsType: TExifDataOffsetsType); override;
- end;
-
- EInvalidExifData = class(ECCRExifException);
-
- TJPEGMetaDataKind = (mkExif, mkIPTC, mkXMP);
- TJPEGMetadataKinds = set of TJPEGMetadataKind;
-
- TCustomExifData = class(TComponent)
- public type
- TEnumerator = record
- strict private
- FClient: TCustomExifData;
- FDoneFirst: Boolean;
- FSection: TExifSectionKind;
- function GetCurrent: TExifSection; {$IFDEF CanInline}inline;{$ENDIF}
- public
- constructor Create(AClient: TCustomExifData);
- function MoveNext: Boolean;
- property Current: TExifSection read GetCurrent;
- end;
- TMakerNoteTypePriority = (mtTestForLast, mtTestForFirst);
- strict private class var
- Diag35mm: Extended;
- FMakerNoteClasses: TClassList;
- private
- class procedure InitializeClass(const MakerNoteClasses: array of TExifMakerNoteClass);
- class procedure FinalizeClass;
- procedure SetGPSDestBearing(const Value: TGPSDestBearing);
- procedure SetGPSImgDirection(const Value: TGPSImgDirection);
- procedure SetGPSTrack(const Value: TGPSTrack);
- strict private
- FAlwaysWritePreciseTimes: Boolean;
- FChangedWhileUpdating: Boolean;
- FEmbeddedIPTC: TIPTCData;
- FEndianness: TEndianness;
- FEnforceASCII: Boolean;
- FEnsureEnumsInRange: Boolean;
- FExifVersion: TCustomExifVersion;
- FFlash: TExifFlashInfo;
- FFlashPixVersion: TCustomExifVersion;
- FFocalPlaneResolution: TCustomExifResolution;
- FGPSAltitude: TGPSAltitude;
- FGPSDestBearing: TGPSDestBearing;
- FGPSDestDistance: TGPSDestDistance;
- FGPSImgDirection: TGPSImgDirection;
- FGPSLatitude, FGPSDestLatitude: TGPSLatitude;
- FGPSLongitude, FGPSDestLongitude: TGPSLongitude;
- FGPSSpeed: TGPSSpeed;
- FGPSTrack: TGPSTrack;
- FGPSVersion: TCustomExifVersion;
- FInteropVersion: TCustomExifVersion;
- FISOSpeedRatings: TISOSpeedRatings;
- FMakerNoteType: TExifMakerNoteClass;
- FMakerNoteValue: TExifMakerNote;
- FOffsetBase: Int64;
- FModified: Boolean;
- FResolution: TCustomExifResolution;
- FSections: array[TExifSectionKind] of TExifSection;
- FThumbnailOrNil: TJPEGImage;
- FThumbnailResolution: TCustomExifResolution;
- FUpdateCount: Integer;
- FXMPPacket: TXMPPacket;
- FOnChange: TNotifyEvent;
- procedure SetEndianness(Value: TEndianness);
- function GetMakerNote: TExifMakerNote;
- function GetSection(Section: TExifSectionKind): TExifSection; //inline;
- procedure SetModified(Value: Boolean);
- function GetThumbnail: TJPEGImage;
- procedure SetThumbnail(Value: TJPEGImage);
- procedure ThumbnailChanged(Sender: TObject);
- function GetDateTime: TDateTimeTagValue;
- procedure SetDateTime(const Value: TDateTimeTagValue);
- function GetGeneralString(TagID: Integer): string;
- procedure SetGeneralString(TagID: Integer; const Value: string);
- function GetGeneralWinString(TagID: Integer): UnicodeString;
- procedure SetGeneralWinString(TagID: Integer; const Value: UnicodeString);
- function GetDetailsDateTime(TagID: Integer): TDateTimeTagValue;
- procedure SetDetailsDateTime(TagID: Integer; const Value: TDateTimeTagValue);
- function GetDetailsFraction(TagID: Integer): TExifFraction;
- procedure SetDetailsFraction(TagID: Integer; const Value: TExifFraction);
- function GetDetailsSFraction(TagID: Integer): TExifSignedFraction;
- procedure SetDetailsSFraction(TagID: Integer; const Value: TExifSignedFraction);
- function GetOffsetSchema: TLongIntTagValue;
- procedure SetOffsetSchema(const Value: TLongIntTagValue);
- function GetDetailsLongWord(TagID: Integer): TLongWordTagValue;
- function GetDetailsString(TagID: Integer): string;
- procedure SetDetailsString(TagID: Integer; const Value: string);
- function GetAuthor: UnicodeString;
- procedure SetAuthor(const Value: UnicodeString);
- function GetComments: UnicodeString;
- procedure SetComments(const Value: UnicodeString);
- function GetUserRating: TWindowsStarRating;
- procedure SetUserRating(const Value: TWindowsStarRating);
- procedure SetFlash(Value: TExifFlashInfo);
- procedure SetFocalPlaneResolution(Value: TCustomExifResolution);
- procedure SetResolution(Value: TCustomExifResolution);
- procedure SetThumbnailResolution(Value: TCustomExifResolution);
- procedure SetGPSVersion(Valu…