This repository was archived by the owner on Dec 8, 2017. It is now read-only.
forked from cutec-chris/dexif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdEXIF.pas
3569 lines (3256 loc) · 119 KB
/
dEXIF.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
unit dEXIF;
////////////////////////////////////////////////////////////////////////////////
// unit dEXIF - Copyright 2001-2006, Gerry McGuire
//--------------------------------------------------------------------------
// Program to pull the information out of various types of EXIF digital
// camera files and show it in a reasonably consistent way
//
// This module parses the very complicated exif structures.
//
// Matthias Wandel, Dec 1999 - August 2000 (most of the comments)
//
// Translated to Delphi:
// Gerry McGuire, March - April 2001 - Currently - read only
// May 2001 - add EXIF to jpeg output files
// September 2001 - read TIF files, IPTC data
// June 2003 - First (non-beta) Release
//--------------------------------------------------------------------------
// In addition to the basic information provided by Matthias, the
// following web page contains reference informtion regarding the
// exif standard: http://www.pima.net/standards/iso/tc42/wg18/WG18_POW.htm
// (the documents themselves are PDF).
//--------------------------------------------------------------------------
// 17.05.2002 MS Corrections/additions M. Schwaiger
//--------------------------------------------------------------------------
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
{$I dExif.inc}
interface
uses
SysUtils, Classes, Math, Variants,
{$IFDEF FPC}
LazUTF8,
{$ELSE}
{$IFNDEF dExifNoJpeg} jpeg, {$ENDIF}
{$ENDIF}
dGlobal, dUtils, dTags, dIPTC;
const
{
ExifTag = 1; // default tag Types
GpsTag = 2;
ThumbTag = 4;
}
// To be used in Exifobj.IterateFoundTags
GenericEXIF = 0;
CustomEXIF = 1;
// AllEXIF = -1;
GenNone = 0;
GenAll = 255;
GenString = 2;
GenList = 4;
// VLMin = 0;
// VLMax = 1;
type
{ TEndInd }
TEndInd = class
private
FData: ansistring;
public
MotorolaOrder: boolean;
function Get16u(AOffs: integer): word;
function Get32s(AOffs: integer): Longint;
function Get32u(AOffs: integer): Longword;
function Put32s(data: Integer): AnsiString;
procedure WriteInt16(var buff: AnsiString; int,posn: integer);
procedure WriteInt32(var buff: AnsiString; int,posn: longint);
function GetDataBuff: Ansistring;
procedure SetDataBuff(const Value: AnsiString);
property DataBuff: AnsiString read GetDataBuff write SetDataBuff;
end;
{ TImageInfo }
TImageInfo = class(tEndInd)
private
FParent: TObject; // must be cast to TImgData, can't be done here due to unit circular reference
FExifVersion: string;
FITagArray: array of TTagEntry;
FITagCount: integer;
FIThumbArray: array of TTagEntry;
FIThumbCount: integer;
FThumbStart: integer;
FThumbLength: integer;
FThumbType: integer;
FThumbnailBuffer: TBytes;
FThumbnailStartOffset: Integer;
FThumbnailSize: Integer;
FIterator: integer;
FThumbIterator: integer;
// Getter / setter
function GetDateTimeOriginal: TDateTime;
procedure SetDateTimeOriginal(const AValue: TDateTime);
function GetDateTimeDigitized: TDateTime;
procedure SetDateTimeDigitized(const AValue: TDateTime);
function GetDateTimeModified: TDateTime;
procedure SetDateTimeModified(const AValue: TDateTime);
function GetArtist: String;
procedure SetArtist(v: String);
function GetExifComment: String; overload;
procedure SetExifComment(AValue: String);
function GetUserComment(const ATag: TTagEntry): String; overload;
function GetImageDescription: String;
procedure SetImageDescription(const AValue: String);
function GetCameraMake: String;
procedure SetCameraMake(const AValue: String);
function GetCameraModel: String;
procedure SetCameraModel(const AValue: String);
function GetCopyright: String;
procedure SetCopyright(const AValue: String);
function GetGPSCoordinate(ATagName: String;
ACoordType: TGpsCoordType): Extended;
procedure SetGPSCoordinate(ATagName: String; const AValue: Extended;
ACoordType: TGpsCoordType);
function GetGPSLatitude: Extended;
procedure SetGPSLatitude(const AValue: Extended);
function GetGPSLongitude: Extended;
procedure SetGPSLongitude(const AValue: Extended);
function GetHeight: Integer;
procedure Setheight(AValue: Integer);
function GetWidth: Integer;
procedure SetWidth(AValue: Integer);
function GetVersion(ATag: TTagEntry): String;
function GetTagByID(ATagID: Word): TTagEntry;
procedure SetTagByID(ATagID: Word; const AValue: TTagEntry);
function GetTagByIndex(AIndex: Integer): TTagEntry;
procedure SetTagByIndex(AIndex: Integer; const AValue: TTagEntry);
function GetTagByName(ATagName: String): TTagEntry;
procedure SetTagByName(ATagName: String; const AValue: TTagEntry);
function GetTagValue(ATagName: String): variant;
procedure SetTagValue(ATagName: String; AValue: variant);
function GetTagValueAsString(ATagName: String): String;
procedure SetTagValueAsString(ATagName: String; AValue: String);
function GetThumbTagByID(ATagID: Word): TTagEntry;
procedure SetThumbTagByID(ATagID: Word; const AValue: TTagEntry);
function GetThumbTagByIndex(AIndex: Integer): TTagEntry;
procedure SetThumbTagByIndex(AIndex: Integer; const AValue: TTagEntry);
function GetThumbTagByName(ATagName: String): TTagEntry;
procedure SetThumbTagByName(ATagName: String; const AValue: TTagEntry);
function GetThumbTagValue(ATagName: String): Variant;
procedure SetThumbTagValue(ATagName: String; AValue: variant);
function GetThumbTagValueAsString(ATagName: String): string;
procedure SetThumbTagValueAsString(ATagName: String; AValue: String);
procedure InternalGetBinaryTagValue(const ATag: TTagEntry; var ABuffer: ansistring);
function InternalGetTagValue(const ATag: TTagEntry): Variant;
function InternalGetTagValueAsString(const ATag: TTagEntry): String;
procedure InternalSetTagValue(const ATagName: String; AValue: Variant;
ATagTypes: TTagTypes; ABinaryData: Pointer = nil; ABinaryDataCount: Word = 0);
function BinaryTagToStr(const ATag: TTagEntry): String;
function BinaryTagToVar(const ATag: TTagEntry): Variant;
function NumericTagToVar(ABuffer: Pointer; ATagType: Integer): Variant;
procedure VarToNumericTag(AValue:variant; ATag: PTagEntry);
// misc
function CreateTagPtr(const ATagDef: TTagEntry; IsThumbTag: Boolean; AParentID: Word = 0): PTagEntry;
function FindTagPtr(const ATagDef: TTagEntry; IsThumbTag: Boolean): PTagEntry;
(*
function GetTagPtr(ATagTypes: TTagTypes; ATagID: Word; AForceCreate: Boolean=false;
AParentID: word=0; ATagType: word=65535): PTagEntry;
*)
procedure RemoveTag(ATagTypes: TTagTypes; ATagID: Word; AParentID: Word=0);
procedure ClearDirStack;
procedure PushDirStack(dirStart, offsetbase: Integer);
function TestDirStack(dirStart, offsetbase: Integer): boolean;
protected
function AddTagToArray(ANewTag: iTag): integer;
function AddTagToThumbArray(ANewTag: iTag): integer;
procedure Calc35Equiv;
function CvtInt(ABuffer: Pointer; ABufferSize: Integer): Longint;
function Decode: Boolean;
function ExifDateToDateTime(ARawStr: ansistring): TDateTime;
procedure ExtractThumbnail;
function FormatNumber(ABuffer: PByte; ABufferSize: Integer;
AFmt: integer; AFmtStr: string; ADecodeStr: string=''): String;
function GetNumber(ABuffer: PByte; ABufferSize: Integer;
AFmt: integer): double;
function LookupRatio: double;
public
MaxTag: integer;
// Height, Width, HPosn, WPosn: integer;
FlashUsed: integer;
BuildList: integer;
MakerNote: ansistring;
TiffFmt: boolean;
// Add support for thumbnail
ThumbTrace: ansistring;
MaxThumbTag: integer;
// Added the following elements to make the structure a little more code-friendly
TraceLevel: integer;
TraceStr: ansistring;
msTraceStr: ansistring;
msAvailable: boolean;
msName:ansistring;
MakerOffset : integer;
public
constructor Create(AParent: TObject; BuildCode: integer = GenAll);
procedure Assign(source: TImageInfo);
destructor Destroy; override;
// Date/time routines
procedure AdjDateTime(ADays, AHours, AMins, ASecs: integer);
function GetImgDateTime: TDateTime;
// Manufacturer-specific
procedure AddMSTag(ATagName: String; ARawStr: ansistring; AType: word);
// Iterate through found tags
procedure ResetIterator;
procedure ResetThumbIterator;
function IterateFoundTags(TagId:integer; var retVal:TTagEntry):boolean;
function IterateFoundThumbTags(TagId: integer;
var retVal: TTagEntry): boolean;
// Collective output
procedure EXIFArrayToXML(AList: TStrings); overload;
function ToShortString: String; // Summarizes in a single line
function ToLongString(ALabelWidth: Integer = 15): String;
// Special actions
procedure AdjExifSize(AHeight, AWidth: Integer);
// Looking up tags and tag values
function GetRawFloat(ATagName: String): double;
function GetRawInt(ATagName: String): integer;
function GetTagByDesc(SearchStr: String): TTagEntry;
function LookupTagIndex(ATagName: String): integer; virtual;
// function LookupTagVal(ATagName: String): String; virtual;
function LookupTagDefn(ATagName: String): integer;
function LookupTagByDesc(ADesc: String): integer;
function LookupTagInt(ATagName: String): integer;
// Tag values as variant
property TagValue[ATagName: String]: Variant
read GetTagValue write SetTagValue; default;
// Tag values as string
property TagValueAsString[ATagName: String]: String
read GetTagValueAsString write SetTagValueAsString;
// Accessing entire tag record
property TagByID[ATagID: Word]: TTagEntry
read GetTagByID write SetTagByID;
property TagByIndex[AIndex: Integer]: TTagEntry
read GetTagByIndex write SetTagByIndex;
property TagByName[ATagName: String]: TTagEntry
read GetTagByName write SetTagByName;
property TagCount: Integer
read fiTagCount;
property Artist: String
read GetArtist write SetArtist;
property CameraMake: String
read GetCameraMake write SetCameraMake;
property CameraModel: String
read GetCameraModel write SetCameraModel;
property Copyright: String
read GetCopyright write SetCopyright;
property DateTimeOriginal: TDateTime
read GetDateTimeOriginal write SetDateTimeOriginal;
property DateTimeDigitized: TDateTime
read GetDateTimeDigitized write SetDateTimeDigitized;
property DateTimeModified: TDateTime
read GetDateTimeModified write SetDateTimeModified;
property ExifComment: String
read GetExifComment write SetExifComment;
property ExifVersion: String
read FExifVersion;
property GPSLatitude: Extended
read GetGPSLatitude write SetGPSLatitude;
property GPSLongitude: Extended
read GetGPSLongitude write SetGPSLongitude;
property ImageDescription: String
read GetImageDescription write SetImageDescription;
property Height: Integer
read GetHeight write SetHeight;
property Width: Integer
read GetWidth write SetWidth;
public
// General processing, called internally
procedure ProcessExifDir(DirStart, OffsetBase, ExifLength: LongInt;
ATagType: TTagType = ttExif; APrefix: string=''; AParentID: word=0);
procedure ProcessHWSpecific(AMakerBuff: ansistring;
TagTbl: array of TTagEntry; ADirStart, AMakerOffset: Longint;
spOffset: integer = 0);
public
// Thumbnail
procedure CreateThumbnail(AThumbnailSize: Integer = DEFAULT_THUMBNAIL_SIZE);
function HasThumbnail: boolean;
procedure ProcessThumbnail;
procedure RemoveThumbnail;
procedure LoadThumbnailFromStream(AStream: TStream);
procedure SaveThumbnailToStream(AStream: TStream);
property ThumbnailBuffer: TBytes
read FThumbnailBuffer;
property ThumbTagByID[ATagID: Word]: TTagEntry
read GetThumbTagByID write SetThumbTagByID;
property ThumbTagByIndex[AIndex: Integer]: TTagEntry
read GetThumbTagByIndex write SetThumbTagByIndex;
property ThumbTagCount: Integer
read fiThumbCount;
property ThumbTagValue[ATagName: String]: variant
read GetThumbTagValue write SetThumbTagValue;
property ThumbTagValueAsString[ATagName: String]: String
read GetThumbTagValueAsString;
property Parent: TObject
read FParent;
end; // TInfoData
var
CurTagArray: TImageInfo = nil;
fmtInt: tfmtInt = defIntFmt;
fmtReal: tfmtReal = defRealFmt;
fmtFrac: tfmtFrac = defFracFmt;
ExifNonThumbnailLength : integer;
ShowTags: integer;
ExifTrace: integer = 0;
function FindExifTagDefByID(ATagID: Word): PTagEntry;
function FindGPSTagDefByID(ATagID: Word): PTagEntry;
function FindExifTagDefByName(ATagName: String): PTagEntry;
function FindGPSTagDefByName(ATagName: String): PTagEntry;
function LookupType(idx: integer): String;
implementation
uses
dMetadata, msData;
const
// Compression Type Constants
JPEG_COMP_TYPE = 6;
TIFF_COMP_TYPE = 1;
GPSCnt = 32;
ExifTagCnt = 251; // NOTE: was 250 before, but "count" is 251
TotalTagCnt = GPSCnt + ExifTagCnt;
{ Many tags added based on Php4 source...
http://lxr.php.net/source/php4/ext/exif/exif.c
See also: https://sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html }
var
TagTable : array [0..ExifTagCnt-1] of TTagEntry =
// TagTable : array of TTagEntry =
// TagTable : TTagDefArray [0..ExifTagCnt] =
// TagTable: TTagDefArray =
((TID:0; TType:2; Tag:$0001; Count:1; Name:'InteroperabilityIndex' ), {0}
(TID:0; TType:7; Tag:$0002; Count:1; Name:'InteroperabilityVersion';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:4; Callback:VersionCallback),
(TID:0; TType:2; Tag:$000B; Count:1; Name:'ACDComment' ),
(TID:0; TType:4; Tag:$00FE; Count:1; Name:'NewSubfileType' ),
(TID:0; TType:3; Tag:$00FF; Count:1; Name:'SubfileType' ),
(TID:0; TType:4; Tag:$0100; ParentID:$0000; Count:1; Name:'ImageWidth'),
(TID:0; TType:4; Tag:$0101; ParentID:$0000; Count:1; Name:'ImageLength'),
(TID:0; TType:3; Tag:$0102; ParentID:$0000; Count:3; Name:'BitsPerSample'),
(TID:0; TType:3; Tag:$0103; ParentID:$0000; Count:1; Name:'Compression';
Desc:''; Code:'6:Jpeg,3:Uncompressed,1:TIFF'),
(TID:0; TType:3; Tag:$0106; ParentID:$0000; Count:1; Name:'PhotometricInterpretation';
Desc:''; Code:'1:Monochrome, 2:RGB, 6:YCbCr'),
(TID:0; TType:3; Tag:$010A; ParentID:$0000; Count:1; Name:'FillOrder'), {10}
(TID:0; TType:2; Tag:$010D; ParentID:$0000; Count:1; Name:'DocumentName'),
(TID:0; TType:2; Tag:$010E; ParentID:$0000; Count:1; Name:'ImageDescription'),
(TID:0; TType:2; Tag:$010F; ParentID:$0000; Count:1; Name:'Make'),
(TID:0; TType:2; Tag:$0110; ParentID:$0000; Count:1; Name:'Model'),
(TID:0; TType:4; Tag:$0111; ParentID:$0000; Count:1; Name:'StripOffsets'),
(TID:0; TType:3; Tag:$0112; ParentID:$0000; Count:1; Name:'Orientation';
Desc:''; Code:'1:Horizontal (normal),2:Mirror horizontal,3:Rotate 180,'+
'4:Mirror vertical,5:Mirror horizontal and rotate 270 CW,'+
'6:Rotate 90 CW,7:Mirror horizontal and rotate 90 CW,'+
'8:Rotate 270 CW'),
(TID:0; TType:3; Tag:$0115; ParentID:$0000; Count:1; Name:'SamplesPerPixel'),
(TID:0; TType:4; Tag:$0116; ParentID:$0000; Count:1; Name:'RowsPerStrip'),
(TID:0; TType:4; Tag:$0117; ParentID:$0000; Count:1; Name:'StripByteCounts'),
(TID:0; TType:3; Tag:$0118; ParentID:$0000; Count:1; Name:'MinSampleValue'), {20}
(TID:0; TType:3; Tag:$0119; ParentID:$0000; Count:1; Name:'MaxSampleValue'),
(TID:0; TType:5; Tag:$011A; ParentID:$0000; Count:1; Name:'XResolution'),
// Desc:''; Code:''; Data:''; Raw:''; FormatS:'%f'),
(TID:0; TType:5; Tag:$011B; ParentID:$0000; Count:1; Name:'YResolution'),
// Desc:''; Code:''; Data:''; Raw:''; FormatS:'%f'),
(TID:0; TType:3; Tag:$011C; ParentID:$0000; Count:1; Name:'PlanarConfiguration'),
(TID:0; TType:2; Tag:$011D; ParentID:$0000; Count:1; Name:'PageName'),
(TID:0; TType:5; Tag:$011E; ParentID:$0000; Count:1; Name:'XPosition'),
(TID:0; TType:5; Tag:$011F; ParentID:$0000; Count:1; Name:'YPosition'),
(TID:0; TType:0; Tag:$0120; ParentID:$0000; Count:1; Name:'FreeOffsets'),
(TID:0; TType:0; Tag:$0121; ParentID:$0000; Count:1; Name:'FreeByteCounts'),
(TID:0; TType:3; Tag:$0122; ParentID:$0000; Count:1; Name:'GrayReponseUnit'), {30}
(TID:0; TType:0; Tag:$0123; ParentID:$0000; Count:1; Name:'GrayReponseCurve'),
(TID:0; TType:0; Tag:$0124; ParentID:$0000; Count:1; Name:'T4Options'),
(TID:0; TType:0; Tag:$0125; ParentID:$0000; Count:1; Name:'T6Options'),
(TID:0; TType:3; Tag:$0128; ParentID:$0000; Count:1; Name:'ResolutionUnit';
Desc:''; Code:'1:None specified,2:inches,3:cm'),
(TID:0; TType:3; Tag:$0129; ParentID:$0000; Count:2; Name:'PageNumber'),
(TID:0; TType:3; Tag:$012D; ParentID:$0000; Count:768; Name:'TransferFunction'),
(TID:0; TType:2; Tag:$0131; ParentID:$0000; Count:1; Name:'Software'),
(TID:0; TType:2; Tag:$0132; ParentID:$0000; Count:1; Name:'DateTime'),
(TID:0; TType:2; Tag:$013B; ParentID:$0000; Count:1; Name:'Artist'),
(TID:0; TType:2; Tag:$013C; ParentID:$0000; Count:1; Name:'HostComputer'), {40}
(TID:0; TType:3; Tag:$013D; ParentID:$0000; Count:1; Name:'Predictor'),
(TID:0; TType:5; Tag:$013E; ParentID:$0000; Count:2; Name:'WhitePoint'),
(TID:0; TType:5; Tag:$013F; ParentID:$0000; Count:6; Name:'PrimaryChromaticities'),
(TID:0; TType:0; Tag:$0140; ParentID:$0000; Count:1; Name:'ColorMap'),
(TID:0; TType:3; Tag:$0141; ParentID:$0000; Count:2; Name:'HalfToneHints'),
(TID:0; TType:4; Tag:$0142; ParentID:$0000; Count:1; Name:'TileWidth'),
(TID:0; TType:4; Tag:$0143; ParentID:$0000; Count:1; Name:'TileLength'),
(TID:0; TType:0; Tag:$0144; ParentID:$0000; Count:1; Name:'TileOffsets'),
(TID:0; TType:0; Tag:$0145; ParentID:$0000; Count:1; Name:'TileByteCounts'),
(TID:0; TType:0; Tag:$014A; ParentID:$0000; Count:1; Name:'SubIFDs'), {50}
(TID:0; TType:3; Tag:$014C; ParentID:$0000; Count:1; Name:'InkSet'),
(TID:0; TType:0; Tag:$014D; ParentID:$0000; Count:1; Name:'InkNames'),
(TID:0; TType:0; Tag:$014E; ParentID:$0000; Count:1; Name:'NumberOfInks'),
(TID:0; TType:0; Tag:$0150; ParentID:$0000; Count:1; Name:'DotRange'),
(TID:0; TType:2; Tag:$0151; ParentID:$0000; Count:1; Name:'TargetPrinter'),
(TID:0; TType:0; Tag:$0152; ParentID:$0000; Count:1; Name:'ExtraSample'),
(TID:0; TType:0; Tag:$0153; ParentID:$0000; Count:1; Name:'SampleFormat'),
(TID:0; TType:0; Tag:$0154; ParentID:$0000; Count:1; Name:'SMinSampleValue'),
(TID:0; TType:0; Tag:$0155; ParentID:$0000; Count:1; Name:'SMaxSampleValue'),
(TID:0; TType:0; Tag:$0156; ParentID:$0000; Count:1; Name:'TransferRange'), {60}
(TID:0; TType:0; Tag:$0157; ParentID:$0000; Count:1; Name:'ClipPath'),
(TID:0; TType:0; Tag:$0158; ParentID:$0000; Count:1; Name:'XClipPathUnits'),
(TID:0; TType:0; Tag:$0159; ParentID:$0000; Count:1; Name:'YClipPathUnits'),
(TID:0; TType:0; Tag:$015A; ParentID:$0000; Count:1; Name:'Indexed'),
(TID:0; TType:0; Tag:$015B; ParentID:$0000; Count:1; Name:'JPEGTables'),
(TID:0; TType:0; Tag:$015F; ParentID:$0000; Count:1; Name:'OPIProxy'),
(TID:0; TType:0; Tag:$0200; ParentID:$0000; Count:1; Name:'JPEGProc'),
(TID:0; TType:4; Tag:$0201; ParentID:$0000; Count:1; Name:'JPEGInterchangeFormat';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:4),
(TID:0; TType:4; Tag:$0202; ParentID:$0000; Count:1; Name:'JPEGInterchangeFormatLength'),
(TID:0; TType:0; Tag:$0203; ParentID:$0000; Count:1; Name:'JPEGRestartInterval'), {70}
(TID:0; TType:0; Tag:$0205; ParentID:$0000; Count:1; Name:'JPEGLosslessPredictors'),
(TID:0; TType:0; Tag:$0206; ParentID:$0000; Count:1; Name:'JPEGPointTransforms'),
(TID:0; TType:0; Tag:$0207; ParentID:$0000; Count:1; Name:'JPEGQTables'),
(TID:0; TType:0; Tag:$0208; ParentID:$0000; Count:1; Name:'JPEGDCTables'),
(TID:0; TType:0; Tag:$0209; ParentID:$0000; Count:1; Name:'JPEGACTables'),
(TID:0; TType:5; Tag:$0211; ParentID:$0000; Count:3; Name:'YCbCrCoefficients'),
(TID:0; TType:3; Tag:$0212; ParentID:$0000; Count:2; Name:'YCbCrSubSampling'),
(TID:0; TType:3; Tag:$0213; ParentID:$0000; Count:1; Name:'YCbCrPositioning';
Desc:''; Code:'1:Centered,2:Co-sited'),
(TID:0; TType:5; Tag:$0214; ParentID:$0000; Count:6; Name:'ReferenceBlackWhite'),
(TID:0; TType:1; Tag:$02BC; ParentID:$0000; Count:1; Name:'ExtensibleMetadataPlatform'), {80}
(TID:0; TType:0; Tag:$0301; ParentID:$0000; Count:1; Name:'Gamma'),
(TID:0; TType:0; Tag:$0302; ParentID:$0000; Count:1; Name:'ICCProfileDescriptor'),
(TID:0; TType:0; Tag:$0303; ParentID:$0000; Count:1; Name:'SRGBRenderingIntent'),
(TID:0; TType:0; Tag:$0304; ParentID:$0000; Count:1; Name:'ImageTitle'),
(TID:0; TType:2; Tag:$1000; ParentID:$0000; Count:1; Name:'RelatedImageFileFormat'),
(TID:0; TType:3; Tag:$1001; ParentID:$0000; Count:1; Name:'RelatedImageWidth'),
(TID:0; TType:3; Tag:$1002; ParentID:$0000; Count:1; Name:'RelatedImageHeight'),
(TID:0; TType:0; Tag:$5001; ParentID:$0000; Count:1; Name:'ResolutionXUnit'),
(TID:0; TType:0; Tag:$5002; ParentID:$0000; Count:1; Name:'ResolutionYUnit'),
(TID:0; TType:0; Tag:$5003; ParentID:$0000; Count:1; Name:'ResolutionXLengthUnit'), {90}
(TID:0; TType:0; Tag:$5004; ParentID:$0000; Count:1; Name:'ResolutionYLengthUnit'),
(TID:0; TType:0; Tag:$5005; ParentID:$0000; Count:1; Name:'PrintFlags'),
(TID:0; TType:0; Tag:$5006; ParentID:$0000; Count:1; Name:'PrintFlagsVersion'),
(TID:0; TType:0; Tag:$5007; ParentID:$0000; Count:1; Name:'PrintFlagsCrop'),
(TID:0; TType:0; Tag:$5008; ParentID:$0000; Count:1; Name:'PrintFlagsBleedWidth'),
(TID:0; TType:0; Tag:$5009; ParentID:$0000; Count:1; Name:'PrintFlagsBleedWidthScale'),
(TID:0; TType:0; Tag:$500A; ParentID:$0000; Count:1; Name:'HalftoneLPI'),
(TID:0; TType:0; Tag:$500B; ParentID:$0000; Count:1; Name:'HalftoneLPIUnit'),
(TID:0; TType:0; Tag:$500C; ParentID:$0000; Count:1; Name:'HalftoneDegree'),
(TID:0; TType:0; Tag:$500D; ParentID:$0000; Count:1; Name:'HalftoneShape'), {100}
(TID:0; TType:0; Tag:$500E; ParentID:$0000; Count:1; Name:'HalftoneMisc'),
(TID:0; TType:0; Tag:$500F; ParentID:$0000; Count:1; Name:'HalftoneScreen'),
(TID:0; TType:0; Tag:$5010; ParentID:$0000; Count:1; Name:'JPEGQuality'),
(TID:0; TType:0; Tag:$5011; ParentID:$0000; Count:1; Name:'GridSize'),
(TID:0; TType:0; Tag:$5012; ParentID:$0000; Count:1; Name:'ThumbnailFormat'),
(TID:0; TType:0; Tag:$5013; ParentID:$0000; Count:1; Name:'ThumbnailWidth'),
(TID:0; TType:0; Tag:$5014; ParentID:$0000; Count:1; Name:'ThumbnailHeight'),
(TID:0; TType:0; Tag:$5015; ParentID:$0000; Count:1; Name:'ThumbnailColorDepth'),
(TID:0; TType:0; Tag:$5016; ParentID:$0000; Count:1; Name:'ThumbnailPlanes'),
(TID:0; TType:0; Tag:$5017; ParentID:$0000; Count:1; Name:'ThumbnailRawBytes'), {110}
(TID:0; TType:0; Tag:$5018; ParentID:$0000; Count:1; Name:'ThumbnailSize'),
(TID:0; TType:0; Tag:$5019; ParentID:$0000; Count:1; Name:'ThumbnailCompressedSize'),
(TID:0; TType:0; Tag:$501A; ParentID:$0000; Count:1; Name:'ColorTransferFunction'),
(TID:0; TType:0; Tag:$501B; ParentID:$0000; Count:1; Name:'ThumbnailData'),
(TID:0; TType:0; Tag:$5020; ParentID:$0000; Count:1; Name:'ThumbnailImageWidth'),
(TID:0; TType:0; Tag:$5021; ParentID:$0000; Count:1; Name:'ThumbnailImageHeight'),
(TID:0; TType:0; Tag:$5022; ParentID:$0000; Count:1; Name:'ThumbnailBitsPerSample'),
(TID:0; TType:0; Tag:$5023; ParentID:$0000; Count:1; Name:'ThumbnailCompression'),
(TID:0; TType:0; Tag:$5024; ParentID:$0000; Count:1; Name:'ThumbnailPhotometricInterp'),
(TID:0; TType:0; Tag:$5025; ParentID:$0000; Count:1; Name:'ThumbnailImageDescription'), {120}
(TID:0; TType:2; Tag:$5026; ParentID:$0000; Count:1; Name:'ThumbnailEquipMake'),
(TID:0; TType:2; Tag:$5027; ParentID:$0000; Count:1; Name:'ThumbnailEquipModel'),
(TID:0; TType:0; Tag:$5028; ParentID:$0000; Count:1; Name:'ThumbnailStripOffsets'),
(TID:0; TType:0; Tag:$5029; ParentID:$0000; Count:1; Name:'ThumbnailOrientation'),
(TID:0; TType:0; Tag:$502A; ParentID:$0000; Count:1; Name:'ThumbnailSamplesPerPixel'),
(TID:0; TType:0; Tag:$502B; ParentID:$0000; Count:1; Name:'ThumbnailRowsPerStrip'),
(TID:0; TType:0; Tag:$502C; ParentID:$0000; Count:1; Name:'ThumbnailStripBytesCount'),
(TID:0; TType:0; Tag:$502D; ParentID:$0000; Count:1; Name:'ThumbnailResolutionX'),
(TID:0; TType:0; Tag:$502E; ParentID:$0000; Count:1; Name:'ThumbnailResolutionY'),
(TID:0; TType:0; Tag:$502F; ParentID:$0000; Count:1; Name:'ThumbnailPlanarConfig'), {130}
(TID:0; TType:0; Tag:$5030; ParentID:$0000; Count:1; Name:'ThumbnailResolutionUnit'),
(TID:0; TType:0; Tag:$5031; ParentID:$0000; Count:1; Name:'ThumbnailTransferFunction'),
(TID:0; TType:2; Tag:$5032; ParentID:$0000; Count:1; Name:'ThumbnailSoftwareUsed'),
(TID:0; TType:2; Tag:$5033; ParentID:$0000; Count:1; Name:'ThumbnailDateTime'),
(TID:0; TType:2; Tag:$5034; ParentID:$0000; Count:1; Name:'ThumbnailArtist'),
(TID:0; TType:0; Tag:$5035; ParentID:$0000; Count:1; Name:'ThumbnailWhitePoint'),
(TID:0; TType:0; Tag:$5036; ParentID:$0000; Count:1; Name:'ThumbnailPrimaryChromaticities'),
(TID:0; TType:0; Tag:$5037; ParentID:$0000; Count:1; Name:'ThumbnailYCbCrCoefficients'),
(TID:0; TType:0; Tag:$5038; ParentID:$0000; Count:1; Name:'ThumbnailYCbCrSubsampling'),
(TID:0; TType:0; Tag:$5039; ParentID:$0000; Count:1; Name:'ThumbnailYCbCrPositioning'), {140}
(TID:0; TType:0; Tag:$503A; ParentID:$0000; Count:1; Name:'ThumbnailRefBlackWhite'),
(TID:0; TType:2; Tag:$503B; ParentID:$0000; Count:1; Name:'ThumbnailCopyRight'),
(TID:0; TType:0; Tag:$5090; ParentID:$0000; Count:1; Name:'LuminanceTable'),
(TID:0; TType:0; Tag:$5091; ParentID:$0000; Count:1; Name:'ChrominanceTable'),
(TID:0; TType:0; Tag:$5100; ParentID:$0000; Count:1; Name:'FrameDelay'),
(TID:0; TType:0; Tag:$5101; ParentID:$0000; Count:1; Name:'LoopCount'),
(TID:0; TType:0; Tag:$5110; ParentID:$0000; Count:1; Name:'PixelUnit'),
(TID:0; TType:0; Tag:$5111; ParentID:$0000; Count:1; Name:'PixelPerUnitX'),
(TID:0; TType:0; Tag:$5112; ParentID:$0000; Count:1; Name:'PixelPerUnitY'),
(TID:0; TType:0; Tag:$5113; ParentID:$0000; Count:1; Name:'PaletteHistogram'), {150}
(TID:0; TType:0; Tag:$800D; ParentID:$0000; Count:1; Name:'ImageID'),
(TID:0; TType:0; Tag:$80E3; ParentID:$0000; Count:1; Name:'Matteing'), //* obsoleted by ExtraSamples */
(TID:0; TType:0; Tag:$80E4; ParentID:$0000; Count:1; Name:'DataType'), //* obsoleted by SampleFormat */
(TID:0; TType:0; Tag:$80E5; ParentID:$0000; Count:1; Name:'ImageDepth'),
(TID:0; TType:0; Tag:$80E6; ParentID:$0000; Count:1; Name:'TileDepth'),
(TID:0; TType:3; Tag:$828D; ParentID:$0000; Count:2; Name:'CFARepeatPatternDim'),
(TID:0; TType:1; Tag:$828E; ParentID:$0000; Count:1; Name:'CFAPattern'), //count: ???
(TID:0; TType:0; Tag:$828F; ParentID:$0000; Count:1; Name:'BatteryLevel'),
(TID:0; TType:2; Tag:$8298; ParentID:$0000; Count:1; Name:'Copyright'),
(TID:0; TType:5; Tag:$829A; ParentID:$8769; Count:1; Name:'ExposureTime';
Desc:'Exposure time'; Code:''; Data:''; Raw:''; FormatS:'%s sec'; Size:8; Callback:nil), //SSpeedCallback), {160}
(TID:0; TType:5; Tag:$829D; ParentID:$8769; Count:1; Name:'FNumber';
Desc:''; Code:''; Data:''; Raw:''; FormatS:'F%0.1f'),
(TID:0; TType:4; Tag:$83BB; ParentID:$0000; Count:1; Name:'IPTC/NAA';
Desc:'IPTC/NAA'),
(TID:0; TType:0; Tag:$84E3; ParentID:$0000; Count:1; Name:'IT8RasterPadding'),
(TID:0; TType:0; Tag:$84E5; ParentID:$0000; Count:1; Name:'IT8ColorTable'),
(TID:0; TType:0; Tag:$8649; ParentID:$0000; Count:1; Name:'ImageResourceInformation'),
(TID:0; TType:4; Tag:$8769; ParentID:$0000; Count:1; Name:'ExifOffset';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:4),
(TID:0; TType:0; Tag:$8773; ParentID:$0000; Count:1; Name:'InterColorProfile'),
(TID:0; TType:3; Tag:$8822; ParentID:$8769; Count:1; Name:'ExposureProgram';
Desc:''; Code:'0:Not denfined,1:Manual,2:Program AE,3:Aperture-priority AE,'+
'4:Shutter speed priority AE,5:Creative (slow speed),'+
'6:Action (high speed),7:Portrait,8:Landscape;9:Bulb'),
(TID:0; TType:2; Tag:$8824; ParentID:$8769; Count:1; Name:'SpectralSensitivity'),
(TID:0; TType:4; Tag:$8825; ParentID:$0000; Count:1; Name:'GPSInfo';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:4), {170}
(TID:0; TType:3; Tag:$8827; ParentID:$8769; Count:1; Name:'ISOSpeedRatings'), {171}
(TID:0; TType:0; Tag:$8828; ParentID:$8769; Count:1; Name:'OECF'),
(TID:0; TType:0; Tag:$8829; ParentID:$8769; Count:1; Name:'Interlace'),
(TID:0; TType:8; Tag:$882A; ParentID:$8769; Count:1; Name:'TimeZoneOffset'),
(TID:0; TType:3; Tag:$882B; ParentID:$8769; Count:1; Name:'SelfTimerMode'),
(TID:0; TType:7; Tag:$9000; ParentID:$8769; Count:1; Name:'ExifVersion';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:4; Callback:VersionCallback),
(TID:0; TType:2; Tag:$9003; ParentID:$8769; Count:1; Name:'DateTimeOriginal'),
(TID:0; TType:2; Tag:$9004; ParentID:$8769; Count:1; Name:'DateTimeDigitized'),
(TID:0; TType:7; Tag:$9101; ParentID:$8769; Count:1; Name:'ComponentsConfiguration';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:0; Callback:CompCfgCallBack),
(TID:0; TType:5; Tag:$9102; ParentID:$8769; Count:1; Name:'CompressedBitsPerPixel'), {180}
(TID:0; TType:10; Tag:$9201; ParentID:$8769; Count:1; Name:'ShutterSpeedValue';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:0; Callback:SSpeedCallBack),
(TID:0; TType:5; Tag:$9202; ParentID:$8769; Count:1; Name:'ApertureValue';
Desc:'Aperture value'; Code:''; Data:''; Raw:''; FormatS:'F%0.1f'),
(TID:0; TType:10;Tag:$9203; ParentID:$8769; Count:1; Name:'BrightnessValue'),
(TID:0; TType:10;Tag:$9204; ParentID:$8769; Count:1; Name:'ExposureBiasValue'),
(TID:0; TType:5; Tag:$9205; ParentID:$8769; Count:1; Name:'MaxApertureValue';
Desc:''; Code:''; Data:''; Raw:''; FormatS:'F%0.1f'),
(TID:0; TType:5; Tag:$9206; ParentID:$8769; Count:1; Name:'SubjectDistance'),
(TID:0; TType:3; Tag:$9207; ParentID:$8769; Count:1; Name:'MeteringMode';
Desc:'';
Code:'0:Unknown,1:Average,2:Center,3:Spot,4:Multi-spot,5:Multi-segment,6:Partial'),
(TID:0; TType:3; Tag:$9208; ParentID:$8769; Count:1; Name:'LightSource';
Desc:'';
Code:'0:Unknown,1:Daylight,2:Fluorescent,3:Tungsten,10:Flash,17:Std A,18:Std B,19:Std C'),
(TID:0; TType:3; Tag:$9209; ParentID:$8769; Count:1; Name:'Flash';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:FlashCallBack),
(TID:0; TType:5; Tag:$920A; ParentID:$8769; Count:1; Name:'FocalLength';
Desc:'Focal length'; Code:''; Data:''; Raw:''; FormatS:'%0.1f mm'), {190}
(TID:0; TType:0; Tag:$920B; ParentID:$8769; Count:1; Name:'FlashEnergy'),
(TID:0; TType:0; Tag:$920C; ParentID:$8769; Count:1; Name:'SpatialFrequencyResponse'),
(TID:0; TType:0; Tag:$920D; ParentID:$8769; Count:1; Name:'Noise'),
(TID:0; TType:0; Tag:$920E; ParentID:$8769; Count:1; Name:'FocalPlaneXResolution';
Desc:''; code:''; Data:''; Raw:''; FormatS:'%f'; Size:0; CallBack:nil),
(TID:0; TType:0; Tag:$920F; ParentID:$8769; Count:1; Name:'FocalPlaneYResolution';
Desc:''; Code:''; Data:''; Raw:''; FormatS:'%f'; Size:0; CallBack:nil),
(TID:0; TType:0; Tag:$9210; ParentID:$8769; Count:1; Name:'FocalPlaneResolutionUnit';
Desc:''; Code:'1:None specified,2:inches,3:cm'),
(TID:0; TType:4; Tag:$9211; ParentID:$8769; Count:1; Name:'ImageNumber'),
(TID:0; TType:2; Tag:$9212; ParentID:$8769; Count:1; Name:'SecurityClassification'),
(TID:0; TType:2; Tag:$9213; ParentID:$8769; Count:1; Name:'ImageHistory'),
(TID:0; TType:3; Tag:$9214; ParentID:$8769; Count:2; Name:'SubjectLocation'), {200}
(TID:0; TType:0; Tag:$9215; ParentID:$8769; Count:1; Name:'ExposureIndex'),
(TID:0; TType:0; Tag:$9216; ParentID:$8769; Count:1; Name:'TIFF/EPStandardID'),
(TID:0; TType:0; Tag:$9217; ParentID:$8769; Count:1; Name:'SensingMethod'),
(TID:0; TType:0; Tag:$923F; ParentID:$8769; Count:1; Name:'StoNits'),
(TID:0; TType:7; Tag:$927C; ParentID:$8769; Count:1; Name:'MakerNote'),
(TID:0; TType:7; Tag:$9286; ParentID:$8769; Count:1; Name:'UserComment'),
(TID:0; TType:2; Tag:$9290; ParentID:$8769; Count:1; Name:'SubSecTime'),
(TID:0; TType:2; Tag:$9291; ParentID:$8769; Count:1; Name:'SubSecTimeOriginal'),
(TID:0; TType:2; Tag:$9292; ParentID:$8769; Count:1; Name:'SubSecTimeDigitized'),
(TID:0; TType:0; Tag:$953C; ParentID:$0000; Count:1; Name:'ImageSourceData'), // "Adobe Photoshop Document Data Block": 8BIM... {210}
(TID:0; TType:0; Tag:$9C9B; ParentID:$0000; Count:1; Name:'Title';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:xpTranslate), // Win XP specific, Unicode
(TID:0; TType:0; Tag:$9C9C; ParentID:$0000; Count:1; Name:'Comments';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:xpTranslate), // Win XP specific, Unicode
(TID:0; TType:0; Tag:$9C9D; ParentID:$0000; Count:1; Name:'Author';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:xpTranslate), // Win XP specific, Unicode
(TID:0; TType:0; Tag:$9C9E; ParentID:$0000; Count:1; Name:'Keywords';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:xpTranslate), // Win XP specific, Unicode
(TID:0; TType:0; Tag:$9C9F; ParentID:$0000; Count:1; Name:'Subject';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:xpTranslate), // Win XP specific, Unicode
(TID:0; TType:0; Tag:$A000; ParentID:$8769; Count:1; Name:'FlashPixVersion'),
(TID:0; TType:3; Tag:$A001; ParentID:$8769; Count:1; Name:'ColorSpace';
Desc:''; Code:'0:sBW,1:sRGB'),
(TID:0; TType:3; Tag:$A002; ParentID:$8769; Count:1; Name:'ExifImageWidth'),
(TID:0; TType:3; Tag:$A003; ParentID:$8769; Count:1; Name:'ExifImageLength'),
(TID:0; TType:2; Tag:$A004; ParentID:$8769; Count:1; Name:'RelatedSoundFile'), {220}
(TID:0; TType:0; Tag:$A005; ParentID:$8769; Count:1; Name:'InteroperabilityOffset'),
(TID:0; TType:5; Tag:$A20B; ParentID:$8769; Count:1; Name:'FlashEnergy'), // TID:0;TType:0;ICode: 2;Tag: $920B in TIFF/EP
(TID:0; TType:0; Tag:$A20C; ParentID:$8769; Count:1; Name:'SpatialFrequencyResponse'), // TID:0;TType:0;ICode: 2;Tag: $920C - -
(TID:0; TType:5; Tag:$A20E; ParentID:$8769; Count:1; Name:'FocalPlaneXResolution';
Desc:''; code:''; Data:''; Raw:''; FormatS:'%f'; Size:0; CallBack:nil),
(TID:0; TType:5; Tag:$A20F; ParentID:$8769; Count:1; Name:'FocalPlaneYResolution';
Desc:''; code:''; Data:''; Raw:''; FormatS:'%f'; Size:0; CallBack:nil),
(TID:0; TType:3; Tag:$A210; ParentID:$8769; Count:1; Name:'FocalPlaneResolutionUnit';
Desc:''; Code:'1:None specified,2:inches,3:cm'), // TID:0;TType:0;ICode: 2;Tag: $9210 - -
(TID:0; TType:0; Tag:$A211; ParentID:$8769; Count:1; Name:'ImageNumber'),
(TID:0; TType:0; Tag:$A212; ParentID:$8769; Count:1; Name:'SecurityClassification'),
(TID:0; TType:0; Tag:$A213; ParentID:$8769; Count:1; Name:'ImageHistory'),
(TID:0; TType:3; Tag:$A214; ParentID:$8769; Count:2; Name:'SubjectLocation'), {230}
(TID:0; TType:5; Tag:$A215; ParentID:$8769; Count:1; Name:'ExposureIndex'),
(TID:0; TType:0; Tag:$A216; ParentID:$8769; Count:1; Name:'TIFF/EPStandardID';
Desc:'TIFF/EPStandardID'),
(TID:0; TType:3; Tag:$A217; ParentID:$8769; Count:1; Name:'SensingMethod'; Desc:'';
Code:'0:Unknown,1:Not defined,2:One-chip color area,3:Two-chip color area,'+
'4:Three-chip color area,5:Color sequential area,7:Trilinear,'+
'8:Color-sequential linear'),
(TID:0; TType:1; Tag:$A300; ParentID:$8769; Count:1; Name:'FileSource'; Desc:'';
Code:'0:Unknown,1:Film scanner,2:Reflection print scanner,3:Digital camera'),
(TID:0; TType:7; Tag:$A301; ParentID:$8769; Count:1; Name:'SceneType';
Desc:''; Code:'0:Unknown,1:Directly Photographed'),
(TID:0; TType:7; Tag:$A302; ParentID:$8769; Count:1; Name:'CFAPattern'),
(TID:0; TType:3; Tag:$A401; ParentID:$8769; Count:1; Name:'CustomRendered';
Desc:''; Code:'0:Normal,1:Custom'),
(TID:0; TType:3; Tag:$A402; ParentID:$8769; Count:1; Name:'ExposureMode';
Desc:''; Code:'0:Auto,1:Manual,2:Auto bracket'),
(TID:0; TType:3; Tag:$A403; ParentID:$8769; Count:1; Name:'WhiteBalance';
Desc:''; Code:'0:Auto,1:Manual'),
(TID:0; TType:5; Tag:$A404; ParentID:$8769; Count:1; Name:'DigitalZoomRatio'), {240}
(TID:0; TType:3; Tag:$A405; ParentID:$8769; Count:1; Name:'FocalLengthIn35mmFilm';
Desc:'Focal Length in 35mm Film'; Code:''; Data:''; Raw:''; FormatS:'%.1f mm'),
(TID:0; TType:3; Tag:$A406; ParentID:$8769; Count:1; Name:'SceneCaptureType';
Desc:''; Code:'0:Standard,1:Landscape,2:Portrait,3:Night scene'),
(TID:0; TType:3; Tag:$A407; ParentID:$8769; Count:1; Name:'GainControl'; Desc:'';
Code:'0:None,1:Low gain up,2:High gain up,3:Low gain down,4:High gain down'),
(TID:0; TType:3; Tag:$A408; ParentID:$8769; Count:1; Name:'Contrast';
Desc:''; Code:'0:Normal,1:Soft,2:Hard'),
(TID:0; TType:3; Tag:$A409; ParentID:$8769; Count:1; Name:'Saturation';
Desc:''; Code:'0:Normal,1:Low,2:High'),
(TID:0; TType:3; Tag:$A40A; ParentID:$8769; Count:1; Name:'Sharpness';
Desc:''; Code:'0:Normal,1:Soft,2:Hard'),
(TID:0; TType:0; Tag:$A40B; ParentID:$8769; Count:1; Name:'DeviceSettingDescription'),
(TID:0; TType:3; Tag:$A40C; ParentID:$8769; Count:1; Name:'SubjectDistanceRange'; {250}
Desc:''; Code:'0:Unknown,1:Macro,2:Close view,3:Distant view'),
(TID:0; TType:2; Tag:$A420; ParentID:$8769; Count:1; Name:'ImageUniqueID';
Desc:''; Code:'0:Close view,1:Distant view'),
(TID:0; TType:0; Tag:0; ParentID:$0000; Count:1; Name:'Unknown')
);
GPSTable : array [0..GPSCnt-1] of TTagEntry = (
(TID:0; TType:1; Tag:$000; ParentID:$8825; Count:4; Name:'GPSVersionID';
Desc:''; Code:''; Data:''; RAw:''; FormatS:''; Size:0; CallBack:GpsVersionID),
(TID:0; TType:2; Tag:$001; ParentID:$8825; Count:2; Name:'GPSLatitudeRef'; Desc:''),
(TID:0; TType:5; Tag:$002; ParentID:$8825; Count:3; Name:'GPSLatitude';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:GpsPosn),
(TID:0; TType:2; Tag:$003; ParentID:$8825; Count:2; Name:'GPSLongitudeRef';Desc:''),
(TID:0; TType:5; Tag:$004; ParentID:$8825; Count:3; Name:'GPSLongitude';
Desc:''; Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:GpsPosn),
(TID:0; TType:1; Tag:$005; ParentID:$8825; Count:1; Name:'GPSAltitudeRef'; Desc:'';
Code:'0:Above Sealevel,1:Below Sealevel'),
(TID:0; TType:5; Tag:$006; ParentID:$8825; Count:1; Name:'GPSAltitude'; Desc:'';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:GpsAltitude),
(TID:0; TType:5; Tag:$007; ParentID:$8825; Count:3; Name:'GPSTimeStamp'; Desc:'';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:CvtTime),
(TID:0; TType:2; Tag:$008; ParentID:$8825; Count:1; Name:'GPSSatellites'; Desc:''),
(TID:0; TType:2; Tag:$009; ParentID:$8825; Count:2; Name:'GPSStatus';
Desc:''; Code:'A:Active;V:Void'),
(TID:0; TType:2; Tag:$00A; ParentID:$8825; Count:2; Name:'GPSMeasureMode';
Desc:''; Code:'2:2D,3:3D'),
(TID:0; TType:5; Tag:$00B; ParentID:$8825; Count:1; Name:'GPSDOP'; Desc:''),
(TID:0; TType:2; Tag:$00C; ParentID:$8825; Count:2; Name:'GPSSpeedRef';
Desc:''; Code:'K:km/h,M:mph,N:knots'),
(TID:0; TType:5; Tag:$00D; ParentID:$8825; Count:1; Name:'GPSSpeed'; Desc:''),
(TID:0; TType:2; Tag:$00E; ParentID:$8825; Count:2; Name:'GPSTrackRef';
Desc:''; Code:'M:Magnetic North,T:True North'),
(TID:0; TType:5; Tag:$00F; ParentID:$8825; Count:1; Name:'GPSTrack'; Desc:''),
(TID:0; TType:2; Tag:$010; ParentID:$8825; Count:2; Name:'GPSImageDirectionRef';
Desc:''; Code:'M:Magnetic North,T:True North'),
(TID:0; TType:5; Tag:$011; ParentID:$8825; Count:1; Name:'GPSImageDirection'; Desc:''),
(TID:0; TType:2; Tag:$012; ParentID:$8825; Count:1; Name:'GPSMapDatum'; Desc:''),
(TID:0; TType:2; Tag:$013; ParentID:$8825; Count:2; Name:'GPSDestLatitudeRef';
Desc:''; Code:'N:North,S:South'),
(TID:0; TType:5; Tag:$014; ParentID:$8825; Count:3; Name:'GPSDestLatitude'; Desc:'';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:GpsPosn),
(TID:0; TType:2; Tag:$015; ParentID:$8825; Count:2; Name:'GPSDestLongitudeRef';
Desc:''; Code: 'E:East,W:West'),
(TID:0; TType:5; Tag:$016; ParentID:$8825; Count:3; Name:'GPSDestLongitude'; Desc:'';
Code:''; Data:''; Raw:''; FormatS:''; Size:0; CallBack:GpsPosn),
(TID:0; TType:2; Tag:$017; ParentID:$8825; Count:2; Name:'GPSDestBearingRef';
Desc:''; Code:'M:Magnetic North,T:True North'),
(TID:0; TType:5; Tag:$018; ParentID:$8825; Count:1; Name:'GPSDestBearing'; Desc:''),
(TID:0; TType:2; Tag:$019; ParentID:$8825; Count:2; Name:'GPSDestDistanceRef';
Desc:''; Code:'K:Kilometers,M:Miles,N:Nautic Miles'),
(TID:0; TType:5; Tag:$01A; ParentID:$8825; Count:1; Name:'GPSDestDistance'; Desc:''),
(TID:0; TType:7; Tag:$01B; ParentID:$8825; Count:1; Name:'GPSProcessingMode'; Desc:''),
(TID:0; TType:7; Tag:$01C; ParentID:$8825; Count:1; Name:'GPSAreaInformation'; Desc:''),
(TID:0; TType:2; Tag:$01D; ParentID:$8825; Count:7; Name:'GPSDateStamp'; Desc:''),
(TID:0; TType:3; Tag:$01E; ParentID:$8825; Count:1; Name:'GPSDifferential';
Desc:''; Code:'0:No Correction,1:Differential Correction'),
(TID:0; TType:5; Tag:$01F; ParentID:$8825; Count:1; Name:'GPSHPositioningError'; Desc:'')
);
tagInit : boolean = false;
function FindExifTagDefByName(ATagName: String): PTagEntry;
var
i: Integer;
begin
for i:=0 to High(TagTable) do begin
Result := @TagTable[i];
if AnsiSameText(Result^.Name, ATagName) then
exit;
end;
Result := nil;
end;
function FindExifTagDefByID(ATagID: word): PTagEntry;
var
i: Integer;
begin
for i:=0 to High(TagTable) do begin
Result := @TagTable[i];
if Result^.Tag = ATagID then
exit;
end;
Result := nil;
end;
function FindGpsTagDefByName(ATagName: String): PTagEntry;
var
i: Integer;
begin
for i:=0 to High(GpsTable) do begin
Result := @GpsTable[i];
if AnsiSameText(Result^.Name, ATagName) then
exit;
end;
Result := nil;
end;
function FindGpsTagDefByID(ATagID: word): PTagEntry;
var
i: Integer;
begin
for i:=0 to High(GpsTable) do begin
Result := @GpsTable[i];
if Result^.Tag = ATagID then
exit;
end;
Result := nil;
end;
Procedure FixTagTable(var tags:array of TTagEntry);
var i:integer;
begin
for i := low(tags) to high(tags) do
begin
if Length(tags[i].Desc) <= 0 then
tags[i].Desc := tags[i].Name;
end;
end;
Procedure FixTagTableParse(var tags:array of TTagEntry);
var i:integer;
begin
for i := low(tags) to high(tags) do
begin
if Length(tags[i].Desc) <= 0 then
tags[i].Desc := InsertSpaces(tags[i].Name);
end;
end;
procedure LoadTagDescs(fancy:boolean = false);
begin
if tagInit
then exit
else tagInit := true;
if fancy then
begin
FixTagTableParse(TagTable);
FixTagTableParse(GPSTable);
end
else
begin
FixTagTable(TagTable);
FixTagTable(GPSTable);
end;
end;
function LookupMTagID(idx:integer; ManuTable: array of TTagEntry):integer;
var
i: integer;
begin
result := -1;
for i := 0 to high(ManuTable) do
if ManuTable[i].Tag = idx then
begin
result := i;
break;
end;
end;
function LookupType(idx: integer): String;
var
i: integer;
begin
result := 'Unknown';
// for i := 0 to (Sizeof(ProcessTable) div SizeOf(TTagEntry))-1 do
for i := 0 to High(ProcessTable) do
if ProcessTable[i].Tag = idx then begin
Result := ProcessTable[i].Desc;
exit;
end;
end;
function LookupTagDefByID(idx: integer; ATagType: TTagType = ttExif): integer;
var
i:integer;
begin
Result := -1;
case ATagType of
ttExif, ttThumb:
for i := 0 to ExifTagCnt-1 do
if TagTable[i].Tag = idx then begin
Result := i;
break;
end;
ttGps:
for i := 0 to GPSCnt-1 do
if GPSTable[i].Tag = idx then begin
Result := i;
break;
end;
end;
end;
function FetchTagDefByID(idx: integer; ATagType: TTagType = ttExif): TTagEntry;
var
i: integer;
begin
Result := TagTable[ExifTagCnt-1];
case ATagType of
ttExif, ttThumb:
for i := 0 to ExifTagCnt-1 do
if TagTable[i].Tag = idx then begin
result := TagTable[i];
break;
end;
ttGps:
for i := 0 to GPSCnt-1 do
if GPSTable[i].Tag = idx then begin
result := GPSTable[i];
break;
end;
end;
end;
function LookupCode(ATagID: Word; ATagType: TTagType=ttExif): String; overload;
var
i:integer;
begin
Result := '';
case ATagType of
ttExif, ttThumb:
for i := 0 to ExifTagCnt-1 do
if TagTable[i].Tag = ATagID then begin
Result := TagTable[i].Code;
break;
end;
ttGps:
for i := 0 to GPSCnt-1 do
if GPSTable[i].Tag = ATagID then begin
Result := GPSTable[i].Code;
break;
end;
end;
end;
function LookupCode(ATagID: Word; TagTbl: array of TTagEntry): String; overload;
var
i: integer;
begin
Result := '';
for i := 0 to High(TagTbl) do
if TagTbl[i].Tag = ATagID then begin
Result := TagTbl[i].Code;
break;
end;
end;
{ Tries to find the string AValue within TTagEntry.Code and
returns the numerical value assigned to the Code (before the colon).
Example:
The codes defined for the Tag "ResolutionUnits" are
'1:None Specified,2:Inch,3:Centimeter'.
If AValue is 'Inch' then the value 2 is returned. }
function GetTagCode(ATag: TTagEntry; AValue: String): Integer;
var
i: Integer;
begin
if ATag.Code <> '' then
Result := FindTextIndexInCode(AValue, ATag.Code)
else
if TryStrToInt(AValue, i) then
Result := i
else
Result := -1;
end;
//------------------------------------------------------------------------------
// TEndInd
//
// Here we implement the Endian Independent layer. Outside of these methods
// we don't care about endian issues.
//------------------------------------------------------------------------------
function TEndInd.GetDataBuff: AnsiString;
begin
result := FData;
end;
procedure TEndInd.SetDataBuff(const Value: AnsiString);
begin
FData := Value;
end;
procedure TEndInd.WriteInt16(var buff: AnsiString; int,posn: integer);
begin
if MotorolaOrder then
begin
buff[posn+1] := ansichar(int mod 256);
buff[posn] := ansichar(int div 256);
end
else
begin
buff[posn] := ansichar(int mod 256);
buff[posn+1] := ansichar(int div 256);
end
end;
procedure TEndInd.WriteInt32(var buff: ansistring; int, posn: longint);
begin
if MotorolaOrder then
begin
buff[posn+3] := ansichar(int mod 256);
buff[posn+2] := ansichar((int shr 8) mod 256);
buff[posn+1] := ansichar((int shr 16) mod 256);