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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
|
<?php
/**
* Definitions for XMPReader class.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @ingroup Media
*/
/**
* This class is just a container for a big array
* used by XMPReader to determine which XMP items to
* extract.
*/
class XMPInfo {
/** Get the items array
* @return array XMP item configuration array.
*/
public static function getItems() {
if ( !self::$ranHooks ) {
// This is for if someone makes a custom metadata extension.
// For example, a medical wiki might want to decode DICOM xmp properties.
Hooks::run( 'XMPGetInfo', array( &self::$items ) );
self::$ranHooks = true; // Only want to do this once.
}
return self::$items;
}
static private $ranHooks = false;
/**
* XMPInfo::$items keeps a list of all the items
* we are interested to extract, as well as
* information about the item like what type
* it is.
*
* Format is an array of namespaces,
* each containing an array of tags
* each tag is an array of information about the
* tag, including:
* * map_group - What group (used for precedence during conflicts).
* * mode - What type of item (self::MODE_SIMPLE usually, see above for
* all values).
* * validate - Method to validate input. Could also post-process the
* input. A string value is assumed to be a static method of
* XMPValidate. Can also take a array( 'className', 'methodName' ).
* * choices - Array of potential values (format of 'value' => true ).
* Only used with validateClosed.
* * rangeLow and rangeHigh - Alternative to choices for numeric ranges.
* Again for validateClosed only.
* * children - For MODE_STRUCT items, allowed children.
* * structPart - Indicates that this element can only appear as a member
* of a structure.
*
* Currently this just has a bunch of EXIF values as this class is only half-done.
*/
static private $items = array(
'http://ns.adobe.com/exif/1.0/' => array(
'ApertureValue' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'BrightnessValue' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'CompressedBitsPerPixel' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'DigitalZoomRatio' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'ExposureBiasValue' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'ExposureIndex' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'ExposureTime' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'FlashEnergy' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational',
),
'FNumber' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'FocalLength' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'FocalPlaneXResolution' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'FocalPlaneYResolution' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'GPSAltitude' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational',
),
'GPSDestBearing' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'GPSDestDistance' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'GPSDOP' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'GPSImgDirection' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'GPSSpeed' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'GPSTrack' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'MaxApertureValue' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'ShutterSpeedValue' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
'SubjectDistance' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational'
),
/* Flash */
'Flash' => array(
'mode' => XMPReader::MODE_STRUCT,
'children' => array(
'Fired' => true,
'Function' => true,
'Mode' => true,
'RedEyeMode' => true,
'Return' => true,
),
'validate' => 'validateFlash',
'map_group' => 'exif',
),
'Fired' => array(
'map_group' => 'exif',
'validate' => 'validateBoolean',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'Function' => array(
'map_group' => 'exif',
'validate' => 'validateBoolean',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'Mode' => array(
'map_group' => 'exif',
'validate' => 'validateClosed',
'mode' => XMPReader::MODE_SIMPLE,
'choices' => array( '0' => true, '1' => true,
'2' => true, '3' => true ),
'structPart' => true,
),
'Return' => array(
'map_group' => 'exif',
'validate' => 'validateClosed',
'mode' => XMPReader::MODE_SIMPLE,
'choices' => array( '0' => true,
'2' => true, '3' => true ),
'structPart' => true,
),
'RedEyeMode' => array(
'map_group' => 'exif',
'validate' => 'validateBoolean',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
/* End Flash */
'ISOSpeedRatings' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateInteger'
),
/* end rational things */
'ColorSpace' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '1' => true, '65535' => true ),
),
'ComponentsConfiguration' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateClosed',
'choices' => array( '1' => true, '2' => true, '3' => true, '4' => true,
'5' => true, '6' => true )
),
'Contrast' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '0' => true, '1' => true, '2' => true )
),
'CustomRendered' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '0' => true, '1' => true )
),
'DateTimeOriginal' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateDate',
),
'DateTimeDigitized' => array( /* xmp:CreateDate */
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateDate',
),
/* todo: there might be interesting information in
* exif:DeviceSettingDescription, but need to find an
* example
*/
'ExifVersion' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'ExposureMode' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 2,
),
'ExposureProgram' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 8,
),
'FileSource' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '3' => true )
),
'FlashpixVersion' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'FocalLengthIn35mmFilm' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
),
'FocalPlaneResolutionUnit' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '2' => true, '3' => true ),
),
'GainControl' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 4,
),
/* this value is post-processed out later */
'GPSAltitudeRef' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '0' => true, '1' => true ),
),
'GPSAreaInformation' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'GPSDestBearingRef' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( 'T' => true, 'M' => true ),
),
'GPSDestDistanceRef' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( 'K' => true, 'M' => true,
'N' => true ),
),
'GPSDestLatitude' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateGPS',
),
'GPSDestLongitude' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateGPS',
),
'GPSDifferential' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '0' => true, '1' => true ),
),
'GPSImgDirectionRef' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( 'T' => true, 'M' => true ),
),
'GPSLatitude' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateGPS',
),
'GPSLongitude' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateGPS',
),
'GPSMapDatum' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'GPSMeasureMode' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '2' => true, '3' => true )
),
'GPSProcessingMethod' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'GPSSatellites' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'GPSSpeedRef' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( 'K' => true, 'M' => true,
'N' => true ),
),
'GPSStatus' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( 'A' => true, 'V' => true )
),
'GPSTimeStamp' => array(
'map_group' => 'exif',
// Note: in exif, GPSDateStamp does not include
// the time, where here it does.
'map_name' => 'GPSDateStamp',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateDate',
),
'GPSTrackRef' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( 'T' => true, 'M' => true )
),
'GPSVersionID' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'ImageUniqueID' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'LightSource' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
/* can't use a range, as it skips... */
'choices' => array( '0' => true, '1' => true,
'2' => true, '3' => true, '4' => true,
'9' => true, '10' => true, '11' => true,
'12' => true, '13' => true,
'14' => true, '15' => true,
'17' => true, '18' => true,
'19' => true, '20' => true,
'21' => true, '22' => true,
'23' => true, '24' => true,
'255' => true,
),
),
'MeteringMode' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 6,
'choices' => array( '255' => true ),
),
/* Pixel(X|Y)Dimension are rather useless, but for
* completeness since we do it with exif.
*/
'PixelXDimension' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
),
'PixelYDimension' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
),
'Saturation' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 2,
),
'SceneCaptureType' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 3,
),
'SceneType' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '1' => true ),
),
// Note, 6 is not valid SensingMethod.
'SensingMethod' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 1,
'rangeHigh' => 5,
'choices' => array( '7' => true, 8 => true ),
),
'Sharpness' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 2,
),
'SpectralSensitivity' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
// This tag should perhaps be displayed to user better.
'SubjectArea' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateInteger',
),
'SubjectDistanceRange' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'rangeLow' => 0,
'rangeHigh' => 3,
),
'SubjectLocation' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateInteger',
),
'UserComment' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_LANG,
),
'WhiteBalance' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '0' => true, '1' => true )
),
),
'http://ns.adobe.com/tiff/1.0/' => array(
'Artist' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'BitsPerSample' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateInteger',
),
'Compression' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '1' => true, '6' => true ),
),
/* this prop should not be used in XMP. dc:rights is the correct prop */
'Copyright' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_LANG,
),
'DateTime' => array( /* proper prop is xmp:ModifyDate */
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateDate',
),
'ImageDescription' => array( /* proper one is dc:description */
'map_group' => 'exif',
'mode' => XMPReader::MODE_LANG,
),
'ImageLength' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
),
'ImageWidth' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
),
'Make' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'Model' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
/**** Do not extract this property
* It interferes with auto exif rotation.
* 'Orientation' => array(
* 'map_group' => 'exif',
* 'mode' => XMPReader::MODE_SIMPLE,
* 'validate' => 'validateClosed',
* 'choices' => array( '1' => true, '2' => true, '3' => true, '4' => true, 5 => true,
* '6' => true, '7' => true, '8' => true ),
*),
******/
'PhotometricInterpretation' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '2' => true, '6' => true ),
),
'PlanerConfiguration' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '1' => true, '2' => true ),
),
'PrimaryChromaticities' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateRational',
),
'ReferenceBlackWhite' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateRational',
),
'ResolutionUnit' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '2' => true, '3' => true ),
),
'SamplesPerPixel' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
),
'Software' => array( /* see xmp:CreatorTool */
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
/* ignore TransferFunction */
'WhitePoint' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateRational',
),
'XResolution' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational',
),
'YResolution' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRational',
),
'YCbCrCoefficients' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateRational',
),
'YCbCrPositioning' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateClosed',
'choices' => array( '1' => true, '2' => true ),
),
/********
* Disable extracting this property (bug 31944)
* Several files have a string instead of a Seq
* for this property. XMPReader doesn't handle
* mismatched types very gracefully (it marks
* the entire file as invalid, instead of just
* the relavent prop). Since this prop
* doesn't communicate all that useful information
* just disable this prop for now, until such
* XMPReader is more graceful (bug 32172)
* 'YCbCrSubSampling' => array(
* 'map_group' => 'exif',
* 'mode' => XMPReader::MODE_SEQ,
* 'validate' => 'validateClosed',
* 'choices' => array( '1' => true, '2' => true ),
* ),
*/
),
'http://ns.adobe.com/exif/1.0/aux/' => array(
'Lens' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'SerialNumber' => array(
'map_group' => 'exif',
'mode' => XMPReader::MODE_SIMPLE,
),
'OwnerName' => array(
'map_group' => 'exif',
'map_name' => 'CameraOwnerName',
'mode' => XMPReader::MODE_SIMPLE,
),
),
'http://purl.org/dc/elements/1.1/' => array(
'title' => array(
'map_group' => 'general',
'map_name' => 'ObjectName',
'mode' => XMPReader::MODE_LANG
),
'description' => array(
'map_group' => 'general',
'map_name' => 'ImageDescription',
'mode' => XMPReader::MODE_LANG
),
'contributor' => array(
'map_group' => 'general',
'map_name' => 'dc-contributor',
'mode' => XMPReader::MODE_BAG
),
'coverage' => array(
'map_group' => 'general',
'map_name' => 'dc-coverage',
'mode' => XMPReader::MODE_SIMPLE,
),
'creator' => array(
'map_group' => 'general',
'map_name' => 'Artist', //map with exif Artist, iptc byline (2:80)
'mode' => XMPReader::MODE_SEQ,
),
'date' => array(
'map_group' => 'general',
// Note, not mapped with other date properties, as this type of date is
// non-specific: "A point or period of time associated with an event in
// the lifecycle of the resource"
'map_name' => 'dc-date',
'mode' => XMPReader::MODE_SEQ,
'validate' => 'validateDate',
),
/* Do not extract dc:format, as we've got better ways to determine MIME type */
'identifier' => array(
'map_group' => 'deprecated',
'map_name' => 'Identifier',
'mode' => XMPReader::MODE_SIMPLE,
),
'language' => array(
'map_group' => 'general',
'map_name' => 'LanguageCode', /* mapped with iptc 2:135 */
'mode' => XMPReader::MODE_BAG,
'validate' => 'validateLangCode',
),
'publisher' => array(
'map_group' => 'general',
'map_name' => 'dc-publisher',
'mode' => XMPReader::MODE_BAG,
),
// for related images/resources
'relation' => array(
'map_group' => 'general',
'map_name' => 'dc-relation',
'mode' => XMPReader::MODE_BAG,
),
'rights' => array(
'map_group' => 'general',
'map_name' => 'Copyright',
'mode' => XMPReader::MODE_LANG,
),
// Note: source is not mapped with iptc source, since iptc
// source describes the source of the image in terms of a person
// who provided the image, where this is to describe an image that the
// current one is based on.
'source' => array(
'map_group' => 'general',
'map_name' => 'dc-source',
'mode' => XMPReader::MODE_SIMPLE,
),
'subject' => array(
'map_group' => 'general',
'map_name' => 'Keywords', /* maps to iptc 2:25 */
'mode' => XMPReader::MODE_BAG,
),
'type' => array(
'map_group' => 'general',
'map_name' => 'dc-type',
'mode' => XMPReader::MODE_BAG,
),
),
'http://ns.adobe.com/xap/1.0/' => array(
'CreateDate' => array(
'map_group' => 'general',
'map_name' => 'DateTimeDigitized',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateDate',
),
'CreatorTool' => array(
'map_group' => 'general',
'map_name' => 'Software',
'mode' => XMPReader::MODE_SIMPLE
),
'Identifier' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_BAG,
),
'Label' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'ModifyDate' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'DateTime',
'validate' => 'validateDate',
),
'MetadataDate' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
// map_name to be consistent with other date names.
'map_name' => 'DateTimeMetadata',
'validate' => 'validateDate',
),
'Nickname' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'Rating' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateRating',
),
),
'http://ns.adobe.com/xap/1.0/rights/' => array(
'Certificate' => array(
'map_group' => 'general',
'map_name' => 'RightsCertificate',
'mode' => XMPReader::MODE_SIMPLE,
),
'Marked' => array(
'map_group' => 'general',
'map_name' => 'Copyrighted',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateBoolean',
),
'Owner' => array(
'map_group' => 'general',
'map_name' => 'CopyrightOwner',
'mode' => XMPReader::MODE_BAG,
),
// this seems similar to dc:rights.
'UsageTerms' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_LANG,
),
'WebStatement' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
),
// XMP media management.
'http://ns.adobe.com/xap/1.0/mm/' => array(
// if we extract the exif UniqueImageID, might
// as well do this too.
'OriginalDocumentID' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
// It might also be useful to do xmpMM:LastURL
// and xmpMM:DerivedFrom as you can potentially,
// get the url of this document/source for this
// document. However whats more likely is you'd
// get a file:// url for the path of the doc,
// which is somewhat of a privacy issue.
),
'http://creativecommons.org/ns#' => array(
'license' => array(
'map_name' => 'LicenseUrl',
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'morePermissions' => array(
'map_name' => 'MorePermissionsUrl',
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'attributionURL' => array(
'map_group' => 'general',
'map_name' => 'AttributionUrl',
'mode' => XMPReader::MODE_SIMPLE,
),
'attributionName' => array(
'map_group' => 'general',
'map_name' => 'PreferredAttributionName',
'mode' => XMPReader::MODE_SIMPLE,
),
),
//Note, this property affects how jpeg metadata is extracted.
'http://ns.adobe.com/xmp/note/' => array(
'HasExtendedXMP' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
),
),
/* Note, in iptc schemas, the legacy properties are denoted
* as deprecated, since other properties should used instead,
* and properties marked as deprecated in the standard are
* are marked as general here as they don't have replacements
*/
'http://ns.adobe.com/photoshop/1.0/' => array(
'City' => array(
'map_group' => 'deprecated',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'CityDest',
),
'Country' => array(
'map_group' => 'deprecated',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'CountryDest',
),
'State' => array(
'map_group' => 'deprecated',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'ProvinceOrStateDest',
),
'DateCreated' => array(
'map_group' => 'deprecated',
// marking as deprecated as the xmp prop preferred
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'DateTimeOriginal',
'validate' => 'validateDate',
// note this prop is an XMP, not IPTC date
),
'CaptionWriter' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'Writer',
),
'Instructions' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'SpecialInstructions',
),
'TransmissionReference' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'OriginalTransmissionRef',
),
'AuthorsPosition' => array(
/* This corresponds with 2:85
* By-line Title, which needs to be
* handled weirdly to correspond
* with iptc/exif. */
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE
),
'Credit' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'Source' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'Urgency' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'Category' => array(
// Note, this prop is deprecated, but in general
// group since it doesn't have a replacement.
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'iimCategory',
),
'SupplementalCategories' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_BAG,
'map_name' => 'iimSupplementalCategory',
),
'Headline' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE
),
),
'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/' => array(
'CountryCode' => array(
'map_group' => 'deprecated',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'CountryCodeDest',
),
'IntellectualGenre' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
// Note, this is a six digit code.
// See: http://cv.iptc.org/newscodes/scene/
// Since these aren't really all that common,
// we just show the number.
'Scene' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_BAG,
'validate' => 'validateInteger',
'map_name' => 'SceneCode',
),
/* Note: SubjectCode should be an 8 ascii digits.
* it is not really an integer (has leading 0's,
* cannot have a +/- sign), but validateInteger
* will let it through.
*/
'SubjectCode' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_BAG,
'map_name' => 'SubjectNewsCode',
'validate' => 'validateInteger'
),
'Location' => array(
'map_group' => 'deprecated',
'mode' => XMPReader::MODE_SIMPLE,
'map_name' => 'SublocationDest',
),
'CreatorContactInfo' => array(
/* Note this maps to 2:118 in iim
* (Contact) field. However those field
* types are slightly different - 2:118
* is free form text field, where this
* is more structured.
*/
'map_group' => 'general',
'mode' => XMPReader::MODE_STRUCT,
'map_name' => 'Contact',
'children' => array(
'CiAdrExtadr' => true,
'CiAdrCity' => true,
'CiAdrCtry' => true,
'CiEmailWork' => true,
'CiTelWork' => true,
'CiAdrPcode' => true,
'CiAdrRegion' => true,
'CiUrlWork' => true,
),
),
'CiAdrExtadr' => array( /* address */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiAdrCity' => array( /* city */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiAdrCtry' => array( /* country */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiEmailWork' => array( /* email (possibly separated by ',') */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiTelWork' => array( /* telephone */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiAdrPcode' => array( /* postal code */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiAdrRegion' => array( /* province/state */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CiUrlWork' => array( /* url. Multiple may be separated by comma. */
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
/* End contact info struct properties */
),
'http://iptc.org/std/Iptc4xmpExt/2008-02-29/' => array(
'Event' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
),
'OrganisationInImageName' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_BAG,
'map_name' => 'OrganisationInImage'
),
'PersonInImage' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_BAG,
),
'MaxAvailHeight' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
'map_name' => 'OriginalImageHeight',
),
'MaxAvailWidth' => array(
'map_group' => 'general',
'mode' => XMPReader::MODE_SIMPLE,
'validate' => 'validateInteger',
'map_name' => 'OriginalImageWidth',
),
// LocationShown and LocationCreated are handled
// specially because they are hierarchical, but we
// also want to merge with the old non-hierarchical.
'LocationShown' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_BAGSTRUCT,
'children' => array(
'WorldRegion' => true,
'CountryCode' => true, /* iso code */
'CountryName' => true,
'ProvinceState' => true,
'City' => true,
'Sublocation' => true,
),
),
'LocationCreated' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_BAGSTRUCT,
'children' => array(
'WorldRegion' => true,
'CountryCode' => true, /* iso code */
'CountryName' => true,
'ProvinceState' => true,
'City' => true,
'Sublocation' => true,
),
),
'WorldRegion' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CountryCode' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'CountryName' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
'map_name' => 'Country',
),
'ProvinceState' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
'map_name' => 'ProvinceOrState',
),
'City' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
'Sublocation' => array(
'map_group' => 'special',
'mode' => XMPReader::MODE_SIMPLE,
'structPart' => true,
),
/* Other props that might be interesting but
* Not currently extracted:
* ArtworkOrObject, (info about objects in picture)
* DigitalSourceType
* RegistryId
*/
),
/* Plus props we might want to consider:
* (Note: some of these have unclear/incomplete definitions
* from the iptc4xmp standard).
* ImageSupplier (kind of like iptc source field)
* ImageSupplierId (id code for image from supplier)
* CopyrightOwner
* ImageCreator
* Licensor
* Various model release fields
* Property release fields.
*/
);
}
|