forked from Wolfcast/ccr-exif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCCR.Exif.pas
7405 lines (6715 loc) · 240 KB
/
CCR.Exif.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{**************************************************************************************************}
{ }
{ CCR Exif }
{ https://github.com/Wolfcast/ccr-exif }
{ Copyright (c) 2009-2014 Chris Rolliston. All Rights Reserved. }
{ }
{ This file is part of CCR Exif which is released under the terms of the Mozilla Public License, }
{ v. 2.0. See file LICENSE.txt or go to https://mozilla.org/MPL/2.0/ for full license details. }
{ }
{**************************************************************************************************}
{ }
{ This unit contains classes, types, constants and utility functions for reading and writing image }
{ metadata. }
{ }
{**************************************************************************************************}
{ }
{ Version: 1.5.4 }
{ Last modified: 2024-01-13 }
{ Contributors: Chris Rolliston }
{ }
{**************************************************************************************************}
{$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}