source: extensions/AMetaData/JpegMetaData/TagDefinitions/XmpTags.class.php @ 5237

Last change on this file since 5237 was 5237, checked in by grum, 14 years ago

fix GPS managment with XMP metadata ; and fix some minor bugs

  • Property svn:executable set to *
File size: 62.3 KB
Line 
1<?php
2/*
3 * --:: JPEG MetaDatas ::-------------------------------------------------------
4 *
5 *  Author    : Grum
6 *   email    : grum at piwigo.org
7 *   website  : http://photos.grum.fr
8 *
9 *   << May the Little SpaceFrog be with you ! >>
10 *
11 *
12 * +-----------------------------------------------------------------------+
13 * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
14 * +-----------------------------------------------------------------------+
15 * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
16 * +-----------------------------------------------------------------------+
17 * | This program is free software; you can redistribute it and/or modify  |
18 * | it under the terms of the GNU General Public License as published by  |
19 * | the Free Software Foundation                                          |
20 * |                                                                       |
21 * | This program is distributed in the hope that it will be useful, but   |
22 * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
23 * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
24 * | General Public License for more details.                              |
25 * |                                                                       |
26 * | You should have received a copy of the GNU General Public License     |
27 * | along with this program; if not, write to the Free Software           |
28 * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
29 * | USA.                                                                  |
30 * +-----------------------------------------------------------------------+
31 *
32 *
33 * -----------------------------------------------------------------------------
34 *
35 * The XmpTags is the definition of the XMP tags
36 *
37 * -----------------------------------------------------------------------------
38 */
39
40  require_once(JPEG_METADATA_DIR."TagDefinitions/KnownTags.class.php");
41  require_once(JPEG_METADATA_DIR."TagDefinitions/IfdTags.class.php");
42  require_once(JPEG_METADATA_DIR."TagDefinitions/GpsTags.class.php");
43  require_once(JPEG_METADATA_DIR."TagDefinitions/IptcTags.class.php");
44
45  /**
46   * Define the tags for XMP metadata
47   */
48  class XmpTags extends KnownTags
49  {
50    /**
51     * this function extract from an Xmp Alt structure, the value in the given
52     * lang
53     *
54     * @param Array $tagValues :
55     * @param String $lang : the needed lang
56     * @return String : the value in the specified lang, or in the default lang
57     *                  if there is no specific value for the specified lang
58     */
59    static public function getAltValue($tagValues, $lang="x-default")
60    {
61      /*
62       * test if the $tagValues is valid, otherwise return the $tagValues as
63       * result
64       */
65      if(!is_array($tagValues)) return($tagValues);
66      if(!array_key_exists("type", $tagValues) or
67         !array_key_exists("values", $tagValues) )
68         return($tagValues);
69      if($tagValues['type']!="alt") return($tagValues);
70
71      $returned="";
72      foreach($tagValues['values'] as $key => $val)
73      {
74        if($val['type']['value']==$lang or
75           XmpTags::lang($val['type']['value'])==$lang)
76        {
77          return($val['value']);
78        }
79
80        if($val['type']['value']=="x-default")
81        {
82          $returned=$val['value'];
83        }
84      }
85      return($returned);
86    }
87
88    /**
89     * this function tries to format the lang Id
90     * something like "fr-fr" is returned as "fr_FR"
91     */
92    static private function lang($lang)
93    {
94      $result=preg_match("/([a-z]*)([-|_])([a-z]*)/i", $lang, $arr);
95      if(is_array($arr) and count($arr))
96      {
97        return($arr[1]."_".strtoupper($arr[3]));
98      }
99      else
100      {
101        return($lang);
102      }
103    }
104
105    const TYPE_SIMPLE = 0x00;
106    const TYPE_SEQ = 0x01;
107    const TYPE_BAG = 0x02;
108    const TYPE_ALT = 0x03;
109
110    protected $label = "XMP tags";
111    protected $tags = Array(
112      'xmlns:x' => Array(
113        'implemented'  => false,
114        'translatable' => false,
115        'type'         => self::TYPE_SIMPLE,
116        'schema'       => "xmlns",
117      ),
118
119      'x:xmptk' => Array(
120        'implemented'  => true,
121        'translatable' => false,
122        'type'         => self::TYPE_SIMPLE,
123        'schema'       => "x",
124      ),
125
126
127      'xmlns:rdf' => Array(
128        'implemented'  => false,
129        'translatable' => false,
130        'type'         => self::TYPE_SIMPLE,
131        'schema'       => "xmlns",
132      ),
133
134
135      'rdf:about' => Array(
136        'implemented'  => false,
137        'translatable' => false,
138        'type'         => self::TYPE_SIMPLE,
139        'schema'       => "rdf",
140      ),
141
142      /*
143       * Dublin Core schema
144       */
145      'xmlns:dc' => Array(
146        'implemented'  => false,
147        'translatable' => false,
148        'type'         => self::TYPE_SIMPLE,
149        'schema'       => "xmlns",
150      ),
151      'dc:contributor' => Array(
152        'implemented'  => true,
153        'translatable' => false,
154        'type'         => self::TYPE_BAG,
155        'schema'       => "dc",
156      ),
157      'dc:coverage' => Array(
158        'implemented'  => true,
159        'translatable' => false,
160        'type'         => self::TYPE_SIMPLE,
161        'schema'       => "dc",
162      ),
163      'dc:creator' => Array(
164        'iptcCreator'  => 0x0250,
165        'implemented'  => true,
166        'translatable' => false,
167        'type'         => self::TYPE_SEQ,
168        'schema'       => "dc",
169      ),
170      'dc:date' => Array(
171        'implemented'  => false,
172        'translatable' => false,
173        'type'         => self::TYPE_SEQ,
174        'schema'       => "dc",
175      ),
176      'dc:description' => Array(
177        'iptcTag'      => 0x0278,
178        'implemented'  => true,
179        'translatable' => false,
180        'type'         => self::TYPE_ALT,
181        'schema'       => "dc",
182      ),
183        'dc:format' => Array(
184        'implemented'  => true,
185        'translatable' => false,
186        'type'         => self::TYPE_SIMPLE,
187        'schema'       => "dc",
188      ),
189      'dc:identifier' => Array(
190        'implemented'  => true,
191        'translatable' => false,
192        'type'         => self::TYPE_SIMPLE,
193        'schema'       => "dc",
194      ),
195      'dc:language' => Array(
196        'implemented'  => true,
197        'translatable' => false,
198        'type'         => self::TYPE_BAG,
199        'schema'       => "dc",
200      ),
201      'dc:publisher' => Array(
202        'implemented'  => true,
203        'translatable' => false,
204        'type'         => self::TYPE_BAG,
205        'schema'       => "dc",
206      ),
207      'dc:relation' => Array(
208        'implemented'  => true,
209        'translatable' => false,
210        'type'         => self::TYPE_BAG,
211        'schema'       => "dc",
212      ),
213      'dc:rights' => Array(
214        'iptcTag'      => 0x0274,
215        'implemented'  => true,
216        'translatable' => false,
217        'type'         => self::TYPE_ALT,
218        'schema'       => "dc",
219      ),
220      'dc:source' => Array(
221        'implemented'  => true,
222        'translatable' => false,
223        'type'         => self::TYPE_SIMPLE,
224        'schema'       => "dc",
225      ),
226      'dc:subject' => Array(
227        'iptcTag'      => 0x0219,
228        'implemented'  => true,
229        'translatable' => false,
230        'type'         => self::TYPE_BAG,
231        'schema'       => "dc",
232      ),
233      'dc:title' => Array(
234        'iptcTag'      => 0x0205,
235        'implemented'  => true,
236        'translatable' => false,
237        'type'         => self::TYPE_ALT,
238        'schema'       => "dc",
239      ),
240      'dc:Type' => Array(
241        'implemented'  => true,
242        'translatable' => false,
243        'type'         => self::TYPE_BAG,
244        'schema'       => "dc",
245      ),
246
247      // not present in specification, but found in some files
248      'dc:CreatorTool' => Array(
249        'implemented'  => true,
250        'translatable' => false,
251        'type'         => self::TYPE_SIMPLE,
252        'schema'       => "dc",
253      ),
254
255
256
257      /*
258       * XMP Basic schema
259       */
260      'xmlns:xmp' => Array(
261        'implemented'  => false,
262        'translatable' => false,
263        'type'         => self::TYPE_SIMPLE,
264        'schema'       => "xmlns",
265      ),
266
267      'xmp:Advisory' => Array(
268        'implemented'  => true,
269        'translatable' => false,
270        'type'         => self::TYPE_BAG,
271        'schema'       => "xmp",
272      ),
273      'xmp:BaseURL' => Array(
274        'implemented'  => true,
275        'translatable' => false,
276        'type'         => self::TYPE_SIMPLE,
277        'schema'       => "xmp",
278      ),
279      'xmp:CreateDate' => Array(
280        'implemented'  => true,
281        'translatable' => false,
282        'type'         => self::TYPE_SIMPLE,
283        'schema'       => "xmp",
284      ),
285      'xmp:CreatorTool' => Array(
286        'implemented'  => true,
287        'translatable' => false,
288        'type'         => self::TYPE_SIMPLE,
289        'schema'       => "xmp",
290      ),
291      'xmp:Identifier' => Array(
292        'implemented'  => true,
293        'translatable' => false,
294        'type'         => self::TYPE_BAG,
295        'schema'       => "xmp",
296      ),
297      'xmp:Label' => Array(
298        'implemented'  => true,
299        'translatable' => false,
300        'type'         => self::TYPE_SIMPLE,
301        'schema'       => "xmp",
302      ),
303      'xmp:MetadataDate' => Array(
304        'implemented'  => true,
305        'translatable' => false,
306        'type'         => self::TYPE_SIMPLE,
307        'schema'       => "xmp",
308      ),
309      'xmp:ModifyDate' => Array(
310        'implemented'  => true,
311        'translatable' => false,
312        'type'         => self::TYPE_SIMPLE,
313        'schema'       => "xmp",
314      ),
315      'xmp:Nickname' => Array(
316        'implemented'  => true,
317        'translatable' => false,
318        'type'         => self::TYPE_SIMPLE,
319        'schema'       => "xmp",
320      ),
321      'xmp:Rating' => Array(
322        'implemented'  => true,
323        'translatable' => false,
324        'type'         => self::TYPE_SIMPLE,
325        'schema'       => "xmp",
326      ),
327      'xmp:Thumbnails' => Array(
328        'implemented'  => false,
329        'translatable' => false,
330        'type'         => self::TYPE_ALT,
331        'schema'       => "xmp",
332      ),
333
334      /*
335       * XMP Rights Management schema
336       */
337      'xmlns:xmpRights' => Array(
338        'implemented'  => false,
339        'translatable' => false,
340        'type'         => self::TYPE_SIMPLE,
341        'schema'       => "xmlns",
342      ),
343
344      'xmpRights:Certificate' => Array(
345        'implemented'  => true,
346        'translatable' => false,
347        'type'         => self::TYPE_SIMPLE,
348        'schema'       => "xmpRights",
349      ),
350      'xmpRights:Marked' => Array(
351        'implemented'  => true,
352        'translatable' => true,
353        'type'         => self::TYPE_SIMPLE,
354        'schema'       => "xmpRights",
355      ),
356      'xmpRights:Owner' => Array(
357        'implemented'  => true,
358        'translatable' => false,
359        'type'         => self::TYPE_BAG,
360        'schema'       => "xmpRights",
361      ),
362      'xmpRights:UsageTerms' => Array(
363        'implemented'  => true,
364        'translatable' => false,
365        'type'         => self::TYPE_ALT,
366        'schema'       => "xmpRights",
367      ),
368      'xmpRights:WebStatement' => Array(
369        'implemented'  => true,
370        'translatable' => false,
371        'type'         => self::TYPE_SIMPLE,
372        'schema'       => "xmpRights",
373      ),
374
375
376      /*
377       * XMP Media Management schema
378       */
379      'xmlns:xmpMM' => Array(
380        'implemented'  => false,
381        'translatable' => false,
382        'type'         => self::TYPE_SIMPLE,
383        'schema'       => "xmlns",
384      ),
385
386/*
387 * The DerivedFrom is a ResourceRef structure
388 * Not yet implemented
389 */
390      'xmpMM:DerivedFrom' => Array(
391        'implemented'  => false,
392        'translatable' => false,
393        'type'         => self::TYPE_SIMPLE,
394        'schema'       => "xmpMM",
395      ),
396
397      'xmpMM:DocumentID' => Array(
398        'implemented'  => true,
399        'translatable' => false,
400        'type'         => self::TYPE_SIMPLE,
401        'schema'       => "xmpMM",
402      ),
403/*
404 * The History is a sequence of ResourceEvent structure
405 * Not yet implemented
406 */
407      'xmpMM:History' => Array(
408        'implemented'  => false,
409        'translatable' => false,
410        'type'         => self::TYPE_SEQ,
411        'schema'       => "xmpMM",
412      ),
413
414      'xmpMM:InstanceID' => Array(
415        'implemented'  => true,
416        'translatable' => false,
417        'type'         => self::TYPE_SIMPLE,
418        'schema'       => "xmpMM",
419      ),
420
421/*
422 * The ManagedFrom is a ResourceRef structure
423 * Not yet implemented
424 */
425      'xmpMM:ManagedFrom' => Array(
426        'implemented'  => false,
427        'translatable' => false,
428        'type'         => self::TYPE_SIMPLE,
429        'schema'       => "xmpMM",
430      ),
431      'xmpMM:Manager' => Array(
432        'implemented'  => true,
433        'translatable' => false,
434        'type'         => self::TYPE_SIMPLE,
435        'schema'       => "xmpMM",
436      ),
437      'xmpMM:ManageTo' => Array(
438        'implemented'  => true,
439        'translatable' => false,
440        'type'         => self::TYPE_SIMPLE,
441        'schema'       => "xmpMM",
442      ),
443      'xmpMM:ManageUI' => Array(
444        'implemented'  => true,
445        'translatable' => false,
446        'type'         => self::TYPE_SIMPLE,
447        'schema'       => "xmpMM",
448      ),
449      'xmpMM:ManagerVariant' => Array(
450        'implemented'  => true,
451        'translatable' => false,
452        'type'         => self::TYPE_SIMPLE,
453        'schema'       => "xmpMM",
454      ),
455      'xmpMM:RenditionClass' => Array(
456        'implemented'  => true,
457        'translatable' => false,
458        'type'         => self::TYPE_SIMPLE,
459        'schema'       => "xmpMM",
460      ),
461      'xmpMM:RenditionParams' => Array(
462        'implemented'  => true,
463        'translatable' => false,
464        'type'         => self::TYPE_SIMPLE,
465        'schema'       => "xmpMM",
466      ),
467      'xmpMM:VersionID' => Array(
468        'implemented'  => true,
469        'translatable' => false,
470        'type'         => self::TYPE_SIMPLE,
471        'schema'       => "xmpMM",
472      ),
473/*
474 * The Versions is a sequence of Version structure
475 * Not yet implemented
476 */
477      'xmpMM:Versions' => Array(
478        'implemented'  => false,
479        'translatable' => false,
480        'type'         => self::TYPE_SEQ,
481        'schema'       => "xmpMM",
482      ),
483      'xmpMM:LastURL' => Array(
484        'implemented'  => true,
485        'translatable' => false,
486        'type'         => self::TYPE_SIMPLE,
487        'schema'       => "xmpMM",
488      ),
489
490
491      /*
492       * XMP Basic Job Ticket schema
493       */
494      'xmlns:xmpBJ' => Array(
495        'implemented'  => false,
496        'translatable' => false,
497        'type'         => self::TYPE_SIMPLE,
498        'schema'       => "xmlns",
499      ),
500      'xmpBJ:JobRef' => Array(
501        'implemented'  => false,
502        'translatable' => false,
503        'type'         => self::TYPE_BAG,
504        'schema'       => "xmpBJ",
505      ),
506
507
508      /*
509       * XMP Paged-Text schema
510       *
511       * No implementation for this tag, assuminf they're not needed for
512       * photography
513       */
514      'xmlns:xmpTPg' => Array(
515        'implemented'  => false,
516        'translatable' => false,
517        'type'         => self::TYPE_SIMPLE,
518        'schema'       => "xmlns",
519      ),
520
521      'xmpTPg:MaxPageSize' => Array(
522        'implemented'  => false,
523        'translatable' => false,
524        'type'         => self::TYPE_SIMPLE,
525        'schema'       => "xmpTPg",
526      ),
527      'xmpTPg:NPages' => Array(
528        'implemented'  => false,
529        'translatable' => false,
530        'type'         => self::TYPE_SIMPLE,
531        'schema'       => "xmpTPg",
532      ),
533      'xmpTPg:Fonts' => Array(
534        'implemented'  => false,
535        'translatable' => false,
536        'type'         => self::TYPE_BAG,
537        'schema'       => "xmpTPg",
538      ),
539      'xmpTPg:Colorants' => Array(
540        'implemented'  => false,
541        'translatable' => false,
542        'type'         => self::TYPE_SEQ,
543        'schema'       => "xmpTPg",
544      ),
545      'xmpTPg:PlateNames' => Array(
546        'implemented'  => false,
547        'translatable' => false,
548        'type'         => self::TYPE_SEQ,
549        'schema'       => "xmpTPg",
550      ),
551
552      /*
553       * XMP Dynamic Media schema
554       * ==> seems to be dedicated for video's file, so don't try to implement
555       *     it at now
556       */
557      'xmlns:xmpDM' => Array(
558        'implemented'  => false,
559        'translatable' => false,
560        'type'         => self::TYPE_SIMPLE,
561        'schema'       => "xmlns",
562      ),
563
564
565      /*
566       * Photoshop schema
567       */
568      'xmlns:photoshop' => Array(
569        'implemented'  => false,
570        'translatable' => false,
571        'type'         => self::TYPE_SIMPLE,
572        'schema'       => "xmlns",
573      ),
574
575      'photoshop:AuthorsPosition' => Array(
576        'iptcTag'      => 0x0255,
577        'implemented'  => true,
578        'translatable' => false,
579        'type'         => self::TYPE_SIMPLE,
580        'schema'       => "photoshop",
581      ),
582      'photoshop:CaptionWriter' => Array(
583        'iptcTag'      => 0x027A,
584        'implemented'  => true,
585        'translatable' => false,
586        'type'         => self::TYPE_SIMPLE,
587        'schema'       => "photoshop",
588      ),
589      'photoshop:Category' => Array(
590        'implemented'  => true,
591        'translatable' => false,
592        'type'         => self::TYPE_SIMPLE,
593        'schema'       => "photoshop",
594      ),
595      'photoshop:City' => Array(
596        'iptcTag'      => 0x025A,
597        'implemented'  => true,
598        'translatable' => false,
599        'type'         => self::TYPE_SIMPLE,
600        'schema'       => "photoshop",
601      ),
602      'photoshop:Country' => Array(
603        'iptcTag'      => 0x0265,
604        'implemented'  => true,
605        'translatable' => false,
606        'type'         => self::TYPE_SIMPLE,
607        'schema'       => "photoshop",
608      ),
609      'photoshop:Credit' => Array(
610        'iptcTag'      => 0x026E,
611        'implemented'  => true,
612        'translatable' => false,
613        'type'         => self::TYPE_SIMPLE,
614        'schema'       => "photoshop",
615      ),
616      'photoshop:DateCreated' => Array(
617        'implemented'  => true,
618        'translatable' => false,
619        'type'         => self::TYPE_SIMPLE,
620        'schema'       => "photoshop",
621      ),
622      'photoshop:Headline' => Array(
623        'iptcTag'      => 0x0269,
624        'implemented'  => true,
625        'translatable' => false,
626        'type'         => self::TYPE_SIMPLE,
627        'schema'       => "photoshop",
628      ),
629      'photoshop:Instructions' => Array(
630        'iptcTag'      => 0x228,
631        'implemented'  => true,
632        'translatable' => false,
633        'type'         => self::TYPE_SIMPLE,
634        'schema'       => "photoshop",
635      ),
636      'photoshop:Source' => Array(
637        'iptctag'      => 0x0273,
638        'implemented'  => true,
639        'translatable' => false,
640        'type'         => self::TYPE_SIMPLE,
641        'schema'       => "photoshop",
642      ),
643      'photoshop:State' => Array(
644        'iptcTag'      => 0x25F,
645        'implemented'  => true,
646        'translatable' => false,
647        'type'         => self::TYPE_SIMPLE,
648        'schema'       => "photoshop",
649      ),
650      'photoshop:SupplementalCategories' => Array(
651        'implemented'  => true,
652        'translatable' => false,
653        'type'         => self::TYPE_BAG,
654        'schema'       => "photoshop",
655      ),
656      'photoshop:TransmissionReference' => Array(
657        'iptcTag'      => 0x267,
658        'implemented'  => true,
659        'translatable' => false,
660        'type'         => self::TYPE_SIMPLE,
661        'schema'       => "photoshop",
662      ),
663      'photoshop:Urgency' => Array(
664        'implemented'  => true,
665        'translatable' => true,
666        'type'         => self::TYPE_SIMPLE,
667        'schema'       => "photoshop",
668        'tagValues'    => Array(
669           '0' => 'none',
670           '1' => 'high+++',
671           '2' => 'high++',
672           '3' => 'high+',
673           '4' => 'high',
674           '5' => 'normal',
675           '6' => 'low',
676           '7' => 'low+',
677           '8' => 'low++',
678           '9' => 'none',
679        ),
680      ),
681      // not present in specification but found in some files
682      'photoshop:ICCProfile' => Array(
683        'implemented'  => true,
684        'translatable' => false,
685        'type'         => self::TYPE_SIMPLE,
686        'schema'       => "photoshop",
687      ),
688      'photoshop:ColorMode' => Array(
689        'implemented'  => false,
690        'translatable' => false,
691        'type'         => self::TYPE_SIMPLE,
692        'schema'       => "photoshop",
693      ),
694
695
696      /*
697       * Camera Raw schema
698       */
699      'xmlns:crs' => Array(
700        'implemented'  => false,
701        'translatable' => false,
702        'type'         => self::TYPE_SIMPLE,
703        'schema'       => "xmlns",
704      ),
705      'crs:AutoBrightness' => Array(
706        'implemented'  => true,
707        'translatable' => true,
708        'type'         => self::TYPE_SIMPLE,
709        'schema'       => "crs",
710      ),
711      'crs:AutoContrast' => Array(
712        'implemented'  => true,
713        'translatable' => true,
714        'type'         => self::TYPE_SIMPLE,
715        'schema'       => "crs",
716      ),
717      'crs:AutoExposure' => Array(
718        'implemented'  => true,
719        'translatable' => true,
720        'type'         => self::TYPE_SIMPLE,
721        'schema'       => "crs",
722      ),
723      'crs:AutoShadows' => Array(
724        'implemented'  => true,
725        'translatable' => true,
726        'type'         => self::TYPE_SIMPLE,
727        'schema'       => "crs",
728      ),
729      'crs:BlueHue' => Array(
730        'implemented'  => true,
731        'translatable' => false,
732        'type'         => self::TYPE_SIMPLE,
733        'schema'       => "crs",
734      ),
735      'crs:BlueSaturation' => Array(
736        'implemented'  => true,
737        'translatable' => false,
738        'type'         => self::TYPE_SIMPLE,
739        'schema'       => "crs",
740      ),
741      'crs:Brightness' => Array(
742        'implemented'  => true,
743        'translatable' => false,
744        'type'         => self::TYPE_SIMPLE,
745        'schema'       => "crs",
746      ),
747      'crs:CameraProfile' => Array(
748        'implemented'  => true,
749        'translatable' => false,
750        'type'         => self::TYPE_SIMPLE,
751        'schema'       => "crs",
752      ),
753      'crs:ChromaticAberrationB' => Array(
754        'implemented'  => true,
755        'translatable' => false,
756        'type'         => self::TYPE_SIMPLE,
757        'schema'       => "crs",
758      ),
759      'crs:ChromaticAberrationR' => Array(
760        'implemented'  => true,
761        'translatable' => false,
762        'type'         => self::TYPE_SIMPLE,
763        'schema'       => "crs",
764      ),
765      'crs:ColorNoiseReduction' => Array(
766        'implemented'  => true,
767        'translatable' => false,
768        'type'         => self::TYPE_SIMPLE,
769        'schema'       => "crs",
770      ),
771      'crs:Contrast' => Array(
772        'implemented'  => true,
773        'translatable' => false,
774        'type'         => self::TYPE_SIMPLE,
775        'schema'       => "crs",
776      ),
777      'crs:CropTop' => Array(
778        'implemented'  => true,
779        'translatable' => false,
780        'type'         => self::TYPE_SIMPLE,
781        'schema'       => "crs",
782      ),
783      'crs:CropLeft' => Array(
784        'implemented'  => true,
785        'translatable' => false,
786        'type'         => self::TYPE_SIMPLE,
787        'schema'       => "crs",
788      ),
789      'crs:CropBottom' => Array(
790        'implemented'  => true,
791        'translatable' => false,
792        'type'         => self::TYPE_SIMPLE,
793        'schema'       => "crs",
794      ),
795      'crs:CropRight' => Array(
796        'implemented'  => true,
797        'translatable' => false,
798        'type'         => self::TYPE_SIMPLE,
799        'schema'       => "crs",
800      ),
801      'crs:CropAngle' => Array(
802        'implemented'  => true,
803        'translatable' => false,
804        'type'         => self::TYPE_SIMPLE,
805        'schema'       => "crs",
806      ),
807      'crs:CropWidth' => Array(
808        'implemented'  => true,
809        'translatable' => false,
810        'type'         => self::TYPE_SIMPLE,
811        'schema'       => "crs",
812      ),
813      'crs:CropHeight' => Array(
814        'implemented'  => true,
815        'translatable' => false,
816        'type'         => self::TYPE_SIMPLE,
817        'schema'       => "crs",
818      ),
819      'crs:CropUnits' => Array(
820        'implemented'  => true,
821        'translatable' => true,
822        'type'         => self::TYPE_SIMPLE,
823        'schema'       => "crs",
824        'tagValues'    => Array(
825           '0' => "pixels",
826           '1' => "inches",
827           '2' => "centimeters",
828        ),
829      ),
830      'crs:Exposure' => Array(
831        'implemented'  => true,
832        'translatable' => false,
833        'type'         => self::TYPE_SIMPLE,
834        'schema'       => "crs",
835      ),
836      'crs:GreenHue' => Array(
837        'implemented'  => true,
838        'translatable' => false,
839        'type'         => self::TYPE_SIMPLE,
840        'schema'       => "crs",
841      ),
842      'crs:GreenSaturation' => Array(
843        'implemented'  => true,
844        'translatable' => false,
845        'type'         => self::TYPE_SIMPLE,
846        'schema'       => "crs",
847      ),
848      'crs:HasCrop' => Array(
849        'implemented'  => true,
850        'translatable' => true,
851        'type'         => self::TYPE_SIMPLE,
852        'schema'       => "crs",
853      ),
854      'crs:HasSettings' => Array(
855        'implemented'  => true,
856        'translatable' => true,
857        'type'         => self::TYPE_SIMPLE,
858        'schema'       => "crs",
859      ),
860      'crs:LuminanceSmoothing' => Array(
861        'implemented'  => true,
862        'translatable' => false,
863        'type'         => self::TYPE_SIMPLE,
864        'schema'       => "crs",
865      ),
866      'crs:RawFileName' => Array(
867        'implemented'  => true,
868        'translatable' => false,
869        'type'         => self::TYPE_SIMPLE,
870        'schema'       => "crs",
871      ),
872      'crs:RedHue' => Array(
873        'implemented'  => true,
874        'translatable' => false,
875        'type'         => self::TYPE_SIMPLE,
876        'schema'       => "crs",
877      ),
878      'crs:RedSaturation' => Array(
879        'implemented'  => true,
880        'translatable' => false,
881        'type'         => self::TYPE_SIMPLE,
882        'schema'       => "crs",
883      ),
884      'crs:Saturation' => Array(
885        'implemented'  => true,
886        'translatable' => false,
887        'type'         => self::TYPE_SIMPLE,
888        'schema'       => "crs",
889      ),
890      'crs:Shadows' => Array(
891        'implemented'  => true,
892        'translatable' => false,
893        'type'         => self::TYPE_SIMPLE,
894        'schema'       => "crs",
895      ),
896      'crs:ShadowTint' => Array(
897        'implemented'  => true,
898        'translatable' => false,
899        'type'         => self::TYPE_SIMPLE,
900        'schema'       => "crs",
901      ),
902      'crs:Sharpness' => Array(
903        'implemented'  => true,
904        'translatable' => false,
905        'type'         => self::TYPE_SIMPLE,
906        'schema'       => "crs",
907      ),
908      'crs:Temperature' => Array(
909        'implemented'  => true,
910        'translatable' => false,
911        'type'         => self::TYPE_SIMPLE,
912        'schema'       => "crs",
913      ),
914      'crs:Tint' => Array(
915        'implemented'  => true,
916        'translatable' => false,
917        'type'         => self::TYPE_SIMPLE,
918        'schema'       => "crs",
919      ),
920      'crs:ToneCurve' => Array(
921        'implemented'  => false,
922        'translatable' => false,
923        'type'         => self::TYPE_SEQ,
924        'schema'       => "crs",
925      ),
926      'crs:ToneCurveName' => Array(
927        'implemented'  => true,
928        'translatable' => true,
929        'type'         => self::TYPE_SIMPLE,
930        'schema'       => "crs",
931        'tagValues'    => Array(
932           'Linear'          => "linear",
933           'Medium Contrast' => "Medium Contrast",
934           'Strong Contrast' => "Strong Contrast",
935           'Custom'          => "Custom",
936        ),      ),
937      'crs:Version' => Array(
938        'implemented'  => true,
939        'translatable' => false,
940        'type'         => self::TYPE_SIMPLE,
941        'schema'       => "crs",
942      ),
943      'crs:VignetteAmount' => Array(
944        'implemented'  => true,
945        'translatable' => false,
946        'type'         => self::TYPE_SIMPLE,
947        'schema'       => "crs",
948      ),
949      'crs:VignetteMidpoint' => Array(
950        'implemented'  => true,
951        'translatable' => false,
952        'type'         => self::TYPE_SIMPLE,
953        'schema'       => "crs",
954      ),
955      'crs:Balance' => Array(
956        'implemented'  => true,
957        'translatable' => true,
958        'type'         => self::TYPE_SIMPLE,
959        'schema'       => "crs",
960        'tagValues'    => Array(
961           'As Shot'     => "As Shot",
962           'Auto'        => "Auto",
963           'Daylight'    => "Daylight",
964           'Cloudy'      => "Cloudy",
965           'Shade'       => "Shade",
966           'Tungsten'    => "Tungsten",
967           'Fluorescent' => "Fluorescent",
968           'Flash'       => "Flash",
969           'Custom'      => "Custom",
970        ),
971      ),
972      // not present in specifications, but found in some files
973      'crs:WhiteBalance' => Array(
974        'implemented'  => true,
975        'translatable' => true,
976        'type'         => self::TYPE_SIMPLE,
977        'schema'       => "crs",
978        'tagValues'    => Array(
979           'As Shot'     => "As Shot",
980           'Auto'        => "Auto",
981           'Daylight'    => "Daylight",
982           'Cloudy'      => "Cloudy",
983           'Shade'       => "Shade",
984           'Tungsten'    => "Tungsten",
985           'Fluorescent' => "Fluorescent",
986           'Flash'       => "Flash",
987           'Custom'      => "Custom",
988        ),
989      ),
990
991
992
993      /*
994       * EXIF Schema for TIFF Properties
995       *
996       */
997      'xmlns:tiff' => Array(
998        'implemented'  => false,
999        'translatable' => false,
1000        'type'         => self::TYPE_SIMPLE,
1001        'schema'       => "xmlns",
1002      ),
1003      'tiff:ImageWidth' => Array(
1004        'exifTag'      => 0x0100,
1005        'implemented'  => true,
1006        'translatable' => false,
1007        'type'         => self::TYPE_SIMPLE,
1008        'schema'       => "tiff",
1009      ),
1010      'tiff:ImageLength' => Array(
1011        'exifTag'      => 0x0101,
1012        'implemented'  => true,
1013        'translatable' => false,
1014        'type'         => self::TYPE_SIMPLE,
1015        'schema'       => "tiff",
1016      ),
1017      'tiff:BitsPerSample' => Array(
1018        'exifTag'      => 0x0102,
1019        'implemented'  => true,
1020        'translatable' => false,
1021        'type'         => self::TYPE_SEQ,
1022        'schema'       => "tiff",
1023      ),
1024      'tiff:Compression' => Array(
1025        'exifTag'      => 0x0103,
1026        'implemented'  => true,
1027        'translatable' => false,
1028        'type'         => self::TYPE_SIMPLE,
1029        'schema'       => "tiff",
1030      ),
1031      'tiff:PhotometricInterpretation' => Array(
1032        'exifTag'      => 0x0106,
1033        'implemented'  => true,
1034        'translatable' => false,
1035        'type'         => self::TYPE_SIMPLE,
1036        'schema'       => "tiff",
1037      ),
1038      'tiff:Orientation' => Array(
1039        'exifTag'      => 0x0112,
1040        'implemented'  => true,
1041        'translatable' => false,
1042        'type'         => self::TYPE_SIMPLE,
1043        'schema'       => "tiff",
1044      ),
1045      'tiff:SamplesPerPixel' => Array(
1046        'exifTag'      => 0x0115,
1047        'implemented'  => true,
1048        'translatable' => false,
1049        'type'         => self::TYPE_SIMPLE,
1050        'schema'       => "tiff",
1051      ),
1052      'tiff:PlanarConfiguration' => Array(
1053        'exifTag'      => 0x011C,
1054        'implemented'  => true,
1055        'translatable' => false,
1056        'type'         => self::TYPE_SIMPLE,
1057        'schema'       => "tiff",
1058      ),
1059      'tiff:YCbCrSubSampling' => Array(
1060        'exifTag'      => 0x0212,
1061        'implemented'  => true,
1062        'translatable' => false,
1063        'type'         => self::TYPE_SEQ,
1064        'schema'       => "tiff",
1065      ),
1066      'tiff:YCbCrPositioning' => Array(
1067        'exifTag'      => 0x0213,
1068        'implemented'  => true,
1069        'translatable' => false,
1070        'type'         => self::TYPE_SIMPLE,
1071        'schema'       => "tiff",
1072      ),
1073      'tiff:XResolution' => Array(
1074        'exifTag'      => 0x011A,
1075        'implemented'  => true,
1076        'translatable' => false,
1077        'type'         => self::TYPE_SIMPLE,
1078        'schema'       => "tiff",
1079      ),
1080      'tiff:YResolution' => Array(
1081        'exifTag'      => 0x011B,
1082        'implemented'  => true,
1083        'translatable' => false,
1084        'type'         => self::TYPE_SIMPLE,
1085        'schema'       => "tiff",
1086      ),
1087      'tiff:ResolutionUnit' => Array(
1088        'exifTag'      => 0x0128,
1089        'implemented'  => true,
1090        'translatable' => false,
1091        'type'         => self::TYPE_SIMPLE,
1092        'schema'       => "tiff",
1093      ),
1094      'tiff:TransferFunction' => Array(
1095        'exifTag'      => 0x012D,
1096        'implemented'  => true,
1097        'translatable' => false,
1098        'type'         => self::TYPE_SEQ,
1099        'schema'       => "tiff",
1100      ),
1101      'tiff:WhitePoint' => Array(
1102        'exifTag'      => 0x013E,
1103        'implemented'  => true,
1104        'translatable' => false,
1105        'type'         => self::TYPE_SEQ,
1106        'schema'       => "tiff",
1107      ),
1108      'tiff:PrimaryChromaticities' => Array(
1109        'exifTag'      => 0x013F,
1110        'implemented'  => true,
1111        'translatable' => false,
1112        'type'         => self::TYPE_SEQ,
1113        'schema'       => "tiff",
1114      ),
1115      'tiff:YCbCrCoefficients' => Array(
1116        'exifTag'      => 0x0211,
1117        'implemented'  => true,
1118        'translatable' => false,
1119        'type'         => self::TYPE_SEQ,
1120        'schema'       => "tiff",
1121      ),
1122      'tiff:ReferenceBlackWhite' => Array(
1123        'exifTag'      => 0x0214,
1124        'implemented'  => true,
1125        'translatable' => false,
1126        'type'         => self::TYPE_SEQ,
1127        'schema'       => "tiff",
1128      ),
1129      'tiff:DateTime' => Array(
1130        'exifTag'      => 0x0132,
1131        'implemented'  => true,
1132        'translatable' => false,
1133        'type'         => self::TYPE_SIMPLE,
1134        'schema'       => "tiff",
1135      ),
1136      'tiff:ImageDescription' => Array(
1137        'exifTag'      => 0x010E,
1138        'implemented'  => true,
1139        'translatable' => false,
1140        'type'         => self::TYPE_ALT,
1141        'schema'       => "tiff",
1142      ),
1143      'tiff:Make' => Array(
1144        'exifTag'      => 0x010F,
1145        'implemented'  => true,
1146        'translatable' => false,
1147        'type'         => self::TYPE_SIMPLE,
1148        'schema'       => "tiff",
1149      ),
1150      'tiff:Model' => Array(
1151        'exifTag'      => 0x0110,
1152        'implemented'  => true,
1153        'translatable' => false,
1154        'type'         => self::TYPE_SIMPLE,
1155        'schema'       => "tiff",
1156      ),
1157      'tiff:Software' => Array(
1158        'exifTag'      => 0x0131,
1159        'implemented'  => true,
1160        'translatable' => false,
1161        'type'         => self::TYPE_SIMPLE,
1162        'schema'       => "tiff",
1163      ),
1164      'tiff:Artist' => Array(
1165        'exifTag'      => 0x013B,
1166        'implemented'  => true,
1167        'translatable' => false,
1168        'type'         => self::TYPE_SIMPLE,
1169        'schema'       => "tiff",
1170      ),
1171      'tiff:Copyright' => Array(
1172        'exifTag'      => 0x9298,
1173        'implemented'  => true,
1174        'translatable' => false,
1175        'type'         => self::TYPE_ALT,
1176        'schema'       => "tiff",
1177      ),
1178
1179      /*
1180       * EXIF Schema for EXIF-specific Properties
1181       */
1182      'xmlns:exif' => Array(
1183        'implemented'  => false,
1184        'translatable' => false,
1185        'type'         => self::TYPE_SIMPLE,
1186        'schema'       => "xmlns",
1187      ),
1188      'exif:ExifVersion' => Array(
1189        'exifTag'      => 0x9000,
1190        'implemented'  => true,
1191        'translatable' => false,
1192        'type'         => self::TYPE_SIMPLE,
1193        'schema'       => "exif",
1194      ),
1195      'exif:FlashpixVersion' => Array(
1196        'exifTag'      => 0xA000,
1197        'implemented'  => true,
1198        'translatable' => false,
1199        'type'         => self::TYPE_SIMPLE,
1200        'schema'       => "exif",
1201      ),
1202      'exif:ColorSpace' => Array(
1203        'exifTag'      => 0xA001,
1204        'implemented'  => true,
1205        'translatable' => false,
1206        'type'         => self::TYPE_SIMPLE,
1207        'schema'       => "exif",
1208      ),
1209      'exif:ComponentsConfiguration' => Array(
1210        'exifTag'      => 0x9101,
1211        'implemented'  => true,
1212        'translatable' => false,
1213        'type'         => self::TYPE_SEQ,
1214        'schema'       => "exif",
1215      ),
1216      'exif:CompressedBitsPerPixel' => Array(
1217        'exifTag'      => 0x9102,
1218        'implemented'  => true,
1219        'translatable' => false,
1220        'type'         => self::TYPE_SIMPLE,
1221        'schema'       => "exif",
1222      ),
1223      'exif:PixelXDimension' => Array(
1224        'exifTag'      => 0xA002,
1225        'implemented'  => true,
1226        'translatable' => false,
1227        'type'         => self::TYPE_SIMPLE,
1228        'schema'       => "exif",
1229      ),
1230      'exif:PixelYDimension' => Array(
1231        'exifTag'      => 0xA003,
1232        'implemented'  => true,
1233        'translatable' => false,
1234        'type'         => self::TYPE_SIMPLE,
1235        'schema'       => "exif",
1236      ),
1237      'exif:UserComment' => Array(
1238        'exifTag'      => 0x9286,
1239        'implemented'  => true,
1240        'translatable' => false,
1241        'type'         => self::TYPE_ALT,
1242        'schema'       => "exif",
1243      ),
1244      'exif:RelatedSoundFile' => Array(
1245        'exifTag'      => 0xA004,
1246        'implemented'  => true,
1247        'translatable' => false,
1248        'type'         => self::TYPE_SIMPLE,
1249        'schema'       => "exif",
1250      ),
1251      'exif:DateTimeOriginal' => Array(
1252        'exifTag'      => 0x9003,
1253        'implemented'  => true,
1254        'translatable' => false,
1255        'type'         => self::TYPE_SIMPLE,
1256        'schema'       => "exif",
1257      ),
1258      'exif:DateTimeDigitized' => Array(
1259        'exifTag'      => 0x9004,
1260        'implemented'  => true,
1261        'translatable' => false,
1262        'type'         => self::TYPE_SIMPLE,
1263        'schema'       => "exif",
1264      ),
1265      'exif:ExposureTime' => Array(
1266        'exifTag'      => 0x829A,
1267        'implemented'  => true,
1268        'translatable' => false,
1269        'type'         => self::TYPE_SIMPLE,
1270        'schema'       => "exif",
1271      ),
1272      'exif:FNumber' => Array(
1273        'exifTag'      => 0x829D,
1274        'implemented'  => true,
1275        'translatable' => false,
1276        'type'         => self::TYPE_SIMPLE,
1277        'schema'       => "exif",
1278      ),
1279      'exif:ExposureProgram' => Array(
1280        'exifTag'      => 0x8822,
1281        'implemented'  => true,
1282        'translatable' => false,
1283        'type'         => self::TYPE_SIMPLE,
1284        'schema'       => "exif",
1285      ),
1286      'exif:SpectralSensitivity' => Array(
1287        'exifTag'      => 0x8824,
1288        'implemented'  => true,
1289        'translatable' => false,
1290        'type'         => self::TYPE_SIMPLE,
1291        'schema'       => "exif",
1292      ),
1293      'exif:ISOSpeedRatings' => Array(
1294        'exifTag'      => 0x8827,
1295        'implemented'  => true,
1296        'translatable' => false,
1297        'type'         => self::TYPE_SEQ,
1298        'schema'       => "exif",
1299      ),
1300      'exif:OECF' => Array(
1301        'exifTag'      => 0x8828,
1302        'implemented'  => true,
1303        'translatable' => false,
1304        'type'         => self::TYPE_SIMPLE,
1305        'schema'       => "exif",
1306      ),
1307      'exif:ShutterSpeedValue' => Array(
1308        'exifTag'      => 0x9201,
1309        'implemented'  => true,
1310        'translatable' => false,
1311        'type'         => self::TYPE_SIMPLE,
1312        'schema'       => "exif",
1313      ),
1314      'exif:ApertureValue' => Array(
1315        'exifTag'      => 0x9202,
1316        'implemented'  => true,
1317        'translatable' => false,
1318        'type'         => self::TYPE_SIMPLE,
1319        'schema'       => "exif",
1320      ),
1321      'exif:BrightnessValue' => Array(
1322        'exifTag'      => 0x9203,
1323        'implemented'  => true,
1324        'translatable' => false,
1325        'type'         => self::TYPE_SIMPLE,
1326        'schema'       => "exif",
1327      ),
1328      'exif:ExposureBiasValue' => Array(
1329        'exifTag'      => 0x9204,
1330        'implemented'  => true,
1331        'translatable' => false,
1332        'type'         => self::TYPE_SIMPLE,
1333        'schema'       => "exif",
1334      ),
1335      'exif:MaxApertureValue' => Array(
1336        'exifTag'      => 0x9205,
1337        'implemented'  => true,
1338        'translatable' => false,
1339        'type'         => self::TYPE_SIMPLE,
1340        'schema'       => "exif",
1341      ),
1342      'exif:SubjectDistance' => Array(
1343        'exifTag'      => 0x9206,
1344        'implemented'  => true,
1345        'translatable' => false,
1346        'type'         => self::TYPE_SIMPLE,
1347        'schema'       => "exif",
1348      ),
1349      'exif:MeteringMode' => Array(
1350        'exifTag'      => 0x9207,
1351        'implemented'  => true,
1352        'translatable' => false,
1353        'type'         => self::TYPE_SIMPLE,
1354        'schema'       => "exif",
1355      ),
1356      'exif:LightSource' => Array(
1357        'exifTag'      => 0x9208,
1358        'implemented'  => true,
1359        'translatable' => false,
1360        'type'         => self::TYPE_SIMPLE,
1361        'schema'       => "exif",
1362      ),
1363/*
1364 * The Flash is a sequence of Flash structure
1365 * Don't use the exif:Flash, but the associated tags :
1366 *  exif:Fired, exif:Return, exif:Mode, exif:Function, exif:RedEyeMode
1367 */
1368      'exif:Flash' => Array(
1369        'exifTag'      => 0x9209,
1370        'implemented'  => false,
1371        'translatable' => false,
1372        'type'         => self::TYPE_SIMPLE,
1373        'schema'       => "exif",
1374      ),
1375
1376      'exif:Fired' => Array(
1377        'implemented'  => true,
1378        'translatable' => true,
1379        'type'         => self::TYPE_SIMPLE,
1380        'schema'       => "exif",
1381        'tagValues' => Array(
1382            'False' => "flash did not fire",
1383            'True'  => "flash fired"
1384        ),
1385      ),
1386
1387      'exif:Return' => Array(
1388        'implemented'  => true,
1389        'translatable' => true,
1390        'type'         => self::TYPE_SIMPLE,
1391        'schema'       => "exif",
1392        'tagValues' => Array(
1393            0x00 => "no strobe",
1394            0x01 => "reserved",
1395            0x02 => "strobe return light not detected",
1396            0x03 => "strobe return light detected"
1397        ),
1398      ),
1399
1400      'exif:Mode' => Array(
1401        'implemented'  => true,
1402        'translatable' => true,
1403        'type'         => self::TYPE_SIMPLE,
1404        'schema'       => "exif",
1405        'tagValues' => Array(
1406            0x00 => "Unknown",
1407            0x01 => "compulsory flash firing",
1408            0x02 => "compulsory flash suppression",
1409            0x03 => "auto mode"
1410        ),
1411      ),
1412
1413      'exif:Function' => Array(
1414        'implemented'  => true,
1415        'translatable' => true,
1416        'type'         => self::TYPE_SIMPLE,
1417        'schema'       => "exif",
1418        'tagValues' => Array(
1419            'False' => "flash function present",
1420            'True'  => "no flash function"
1421        ),
1422      ),
1423
1424      'exif:RedEyeMode' => Array(
1425        'implemented'  => true,
1426        'translatable' => true,
1427        'type'         => self::TYPE_SIMPLE,
1428        'schema'       => "exif",
1429        'tagValues' => Array(
1430            'False' => "no red-eye reduction mode or unknown",
1431            'True'  => "red-eye reduction supported"
1432          ),
1433      ),
1434
1435      'exif:FocalLength' => Array(
1436        'exifTag'      => 0x920A,
1437        'implemented'  => true,
1438        'translatable' => false,
1439        'type'         => self::TYPE_SIMPLE,
1440        'schema'       => "exif",
1441      ),
1442      'exif:SubjectArea' => Array(
1443        'exifTag'      => 0x9214,
1444        'implemented'  => true,
1445        'translatable' => false,
1446        'type'         => self::TYPE_SEQ,
1447        'schema'       => "exif",
1448      ),
1449      'exif:FlashEnergy' => Array(
1450        'exifTag'      => 0xA20B,
1451        'implemented'  => true,
1452        'translatable' => false,
1453        'type'         => self::TYPE_SIMPLE,
1454        'schema'       => "exif",
1455      ),
1456      'exif:SpatialFrequencyResponse' => Array(
1457        'exifTag'      => 0xA20C,
1458        'implemented'  => true,
1459        'translatable' => false,
1460        'type'         => self::TYPE_SIMPLE,
1461        'schema'       => "exif",
1462      ),
1463      'exif:FocalPlaneXResolution' => Array(
1464        'exifTag'      => 0xA20E,
1465        'implemented'  => true,
1466        'translatable' => false,
1467        'type'         => self::TYPE_SIMPLE,
1468        'schema'       => "exif",
1469      ),
1470      'exif:FocalPlaneYResolution' => Array(
1471        'exifTag'      => 0xA20F,
1472        'implemented'  => true,
1473        'translatable' => false,
1474        'type'         => self::TYPE_SIMPLE,
1475        'schema'       => "exif",
1476      ),
1477      'exif:FocalPlaneResolutionUnit' => Array(
1478        'exifTag'      => 0xA210,
1479        'implemented'  => true,
1480        'translatable' => false,
1481        'type'         => self::TYPE_SIMPLE,
1482        'schema'       => "exif",
1483      ),
1484      'exif:SubjectLocation' => Array(
1485        'exifTag'      => 0xA214,
1486        'implemented'  => true,
1487        'translatable' => false,
1488        'type'         => self::TYPE_SEQ,
1489        'schema'       => "exif",
1490      ),
1491      'exif:ExposureIndex' => Array(
1492        'exifTag'      => 0xA215,
1493        'implemented'  => true,
1494        'translatable' => false,
1495        'type'         => self::TYPE_SIMPLE,
1496        'schema'       => "exif",
1497      ),
1498      'exif:SensingMethod' => Array(
1499        'exifTag'      => 0xA217,
1500        'implemented'  => true,
1501        'translatable' => false,
1502        'type'         => self::TYPE_SIMPLE,
1503        'schema'       => "exif",
1504      ),
1505      'exif:FileSource' => Array(
1506        'exifTag'      => 0xA300,
1507        'implemented'  => true,
1508        'translatable' => false,
1509        'type'         => self::TYPE_SIMPLE,
1510        'schema'       => "exif",
1511      ),
1512      'exif:SceneType' => Array(
1513        'exifTag'      => 0xA301,
1514        'implemented'  => true,
1515        'translatable' => false,
1516        'type'         => self::TYPE_SIMPLE,
1517        'schema'       => "exif",
1518      ),
1519/*
1520 * The CFAPattern is a CFAPattern structure
1521 * Not yet implemented
1522 */
1523      'exif:CFAPattern' => Array(
1524        'exifTag'      => 0xA302,
1525        'implemented'  => true,
1526        'translatable' => false,
1527        'type'         => self::TYPE_SIMPLE,
1528        'schema'       => "exif",
1529      ),
1530      'exif:CustomRendered' => Array(
1531        'exifTag'      => 0xA401,
1532        'implemented'  => true,
1533        'translatable' => false,
1534        'type'         => self::TYPE_SIMPLE,
1535        'schema'       => "exif",
1536      ),
1537      'exif:ExposureMode' => Array(
1538        'exifTag'      => 0xA402,
1539        'implemented'  => true,
1540        'translatable' => false,
1541        'type'         => self::TYPE_SIMPLE,
1542        'schema'       => "exif",
1543      ),
1544      'exif:Balance' => Array(
1545        'exifTag'      => 0xA403,
1546        'implemented'  => true,
1547        'translatable' => false,
1548        'type'         => self::TYPE_SIMPLE,
1549        'schema'       => "exif",
1550      ),
1551      'exif:WhiteBalance' => Array(
1552        'exifTag'      => 0xA403,
1553        'implemented'  => true,
1554        'translatable' => false,
1555        'type'         => self::TYPE_SIMPLE,
1556        'schema'       => "exif",
1557      ),
1558      'exif:DigitalZoomRatio' => Array(
1559        'exifTag'      => 0xA404,
1560        'implemented'  => true,
1561        'translatable' => false,
1562        'type'         => self::TYPE_SIMPLE,
1563        'schema'       => "exif",
1564      ),
1565      'exif:FocalLengthIn35mmFilm' => Array(
1566        'exifTag'      => 0xA405,
1567        'implemented'  => true,
1568        'translatable' => false,
1569        'type'         => self::TYPE_SIMPLE,
1570        'schema'       => "exif",
1571      ),
1572      'exif:SceneCaptureType' => Array(
1573        'exifTag'      => 0xA406,
1574        'implemented'  => true,
1575        'translatable' => false,
1576        'type'         => self::TYPE_SIMPLE,
1577        'schema'       => "exif",
1578      ),
1579      'exif:GainControl' => Array(
1580        'exifTag'      => 0xA407,
1581        'implemented'  => true,
1582        'translatable' => false,
1583        'type'         => self::TYPE_SIMPLE,
1584        'schema'       => "exif",
1585      ),
1586      'exif:Contrast' => Array(
1587        'exifTag'      => 0xA408,
1588        'implemented'  => true,
1589        'translatable' => false,
1590        'type'         => self::TYPE_SIMPLE,
1591        'schema'       => "exif",
1592      ),
1593      'exif:Saturation' => Array(
1594        'exifTag'      => 0xA409,
1595        'implemented'  => true,
1596        'translatable' => false,
1597        'type'         => self::TYPE_SIMPLE,
1598        'schema'       => "exif",
1599      ),
1600      'exif:Sharpness' => Array(
1601        'exifTag'      => 0xA40A,
1602        'implemented'  => true,
1603        'translatable' => false,
1604        'type'         => self::TYPE_SIMPLE,
1605        'schema'       => "exif",
1606      ),
1607      'exif:DeviceSettingDescription' => Array(
1608        'exifTag'      => 0xA40B,
1609        'implemented'  => true,
1610        'translatable' => false,
1611        'type'         => self::TYPE_SIMPLE,
1612        'schema'       => "exif",
1613      ),
1614      'exif:SubjectDistanceRange' => Array(
1615        'exifTag'      => 0xA40C,
1616        'implemented'  => true,
1617        'translatable' => false,
1618        'type'         => self::TYPE_SIMPLE,
1619        'schema'       => "exif",
1620      ),
1621      'exif:ImageUniqueID' => Array(
1622        'exifTag'      => 0xA420,
1623        'implemented'  => true,
1624        'translatable' => false,
1625        'type'         => self::TYPE_SIMPLE,
1626        'schema'       => "exif",
1627      ),
1628      'exif:GPSVersionID' => Array(
1629        'gpsTag'       => 0x0000,
1630        'implemented'  => true,
1631        'translatable' => false,
1632        'type'         => self::TYPE_SIMPLE,
1633        'schema'       => "exif",
1634      ),
1635      'exif:GPSLatitude' => Array(
1636        'gpsTag'       => 0xFFFF, // combination of tags 0x02 & 0x01
1637        'implemented'  => true,
1638        'translatable' => true,
1639        'type'         => self::TYPE_SIMPLE,
1640        'schema'       => "exif",
1641      ),
1642      'exif:GPSLongitude' => Array(
1643        'gpsTag'       => 0xFFFF, // combination of tags 0x04 & 0x03
1644        'implemented'  => true,
1645        'translatable' => true,
1646        'type'         => self::TYPE_SIMPLE,
1647        'schema'       => "exif",
1648      ),
1649      'exif:GPSAltitudeRef' => Array(
1650        'gpsTag'       => 0x0005,
1651        'implemented'  => true,
1652        'translatable' => false,
1653        'type'         => self::TYPE_SIMPLE,
1654        'schema'       => "exif",
1655      ),
1656      'exif:GPSAltitude' => Array(
1657        'gpsTag'       => 0x0006,
1658        'implemented'  => true,
1659        'translatable' => false,
1660        'type'         => self::TYPE_SIMPLE,
1661        'schema'       => "exif",
1662      ),
1663      'exif:GPSTimeStamp' => Array(
1664        'gpsTag'       => 0xFFFF, // combination of tags 0x1D & 0x07
1665        'implemented'  => true,
1666        'translatable' => false,
1667        'type'         => self::TYPE_SIMPLE,
1668        'schema'       => "exif",
1669      ),
1670      'exif:GPSSatellites' => Array(
1671        'gpsTag'       => 0x0008,
1672        'implemented'  => true,
1673        'translatable' => false,
1674        'type'         => self::TYPE_SIMPLE,
1675        'schema'       => "exif",
1676      ),
1677      'exif:GPSStatus' => Array(
1678        'gpsTag'       => 0x0009,
1679        'implemented'  => true,
1680        'translatable' => false,
1681        'type'         => self::TYPE_SIMPLE,
1682        'schema'       => "exif",
1683      ),
1684      'exif:GPSMeasureMode' => Array(
1685        'gpsTag'       => 0x000A,
1686        'implemented'  => true,
1687        'translatable' => false,
1688        'type'         => self::TYPE_SIMPLE,
1689        'schema'       => "exif",
1690      ),
1691      'exif:GPSDOP' => Array(
1692        'gpsTag'       => 0x000B,
1693        'implemented'  => true,
1694        'translatable' => false,
1695        'type'         => self::TYPE_SIMPLE,
1696        'schema'       => "exif",
1697      ),
1698      'exif:GPSSpeedRef' => Array(
1699        'gpsTag'       => 0x000C,
1700        'implemented'  => true,
1701        'translatable' => false,
1702        'type'         => self::TYPE_SIMPLE,
1703        'schema'       => "exif",
1704      ),
1705      'exif:GPSSpeed' => Array(
1706        'gpsTag'       => 0x000D,
1707        'implemented'  => true,
1708        'translatable' => false,
1709        'type'         => self::TYPE_SIMPLE,
1710        'schema'       => "exif",
1711      ),
1712      'exif:GPSTrackRef' => Array(
1713        'gpsTag'       => 0x000E,
1714        'implemented'  => true,
1715        'translatable' => false,
1716        'type'         => self::TYPE_SIMPLE,
1717        'schema'       => "exif",
1718      ),
1719      'exif:GPSTrack' => Array(
1720        'gpsTag'       => 0x000F,
1721        'implemented'  => true,
1722        'translatable' => false,
1723        'type'         => self::TYPE_SIMPLE,
1724        'schema'       => "exif",
1725      ),
1726      'exif:GPSImgDirectionRef' => Array(
1727        'gpsTag'       => 0x0010,
1728        'implemented'  => true,
1729        'translatable' => false,
1730        'type'         => self::TYPE_SIMPLE,
1731        'schema'       => "exif",
1732      ),
1733      'exif:GPSImgDirection' => Array(
1734        'gpsTag'       => 0x0011,
1735        'implemented'  => true,
1736        'translatable' => false,
1737        'type'         => self::TYPE_SIMPLE,
1738        'schema'       => "exif",
1739      ),
1740      'exif:GPSMapDatum' => Array(
1741        'gpsTag'       => 0x0012,
1742        'implemented'  => true,
1743        'translatable' => false,
1744        'type'         => self::TYPE_SIMPLE,
1745        'schema'       => "exif",
1746      ),
1747      'exif:GPSDestLatitude' => Array(
1748        'gpsTag'       => 0xFFFF,  // combination of tags 0x14 & 0x13
1749        'implemented'  => true,
1750        'translatable' => true,
1751        'type'         => self::TYPE_SIMPLE,
1752        'schema'       => "exif",
1753      ),
1754      'exif:GPSDestLongitude' => Array(
1755        'gpsTag'       => 0xFFFF,  // combination of tags 0x16 & 0x15
1756        'implemented'  => true,
1757        'translatable' => true,
1758        'type'         => self::TYPE_SIMPLE,
1759        'schema'       => "exif",
1760      ),
1761      'exif:GPSDestBearingRef' => Array(
1762        'gpsTag'       => 0x0017,
1763        'implemented'  => true,
1764        'translatable' => false,
1765        'type'         => self::TYPE_SIMPLE,
1766        'schema'       => "exif",
1767      ),
1768      'exif:GPSDestBearing' => Array(
1769        'gpsTag'       => 0x0018,
1770        'implemented'  => true,
1771        'translatable' => false,
1772        'type'         => self::TYPE_SIMPLE,
1773        'schema'       => "exif",
1774      ),
1775      'exif:GPSDestDistanceRef' => Array(
1776        'gpsTag'       => 0x0019,
1777        'implemented'  => true,
1778        'translatable' => false,
1779        'type'         => self::TYPE_SIMPLE,
1780        'schema'       => "exif",
1781      ),
1782      'exif:GPSDestDistance' => Array(
1783        'gpsTag'       => 0x001A,
1784        'implemented'  => true,
1785        'translatable' => false,
1786        'type'         => self::TYPE_SIMPLE,
1787        'schema'       => "exif",
1788      ),
1789      'exif:GPSProcessingMethod' => Array(
1790        'gpsTag'       => 0x001B,
1791        'implemented'  => true,
1792        'translatable' => false,
1793        'type'         => self::TYPE_SIMPLE,
1794        'schema'       => "exif",
1795      ),
1796      'exif:GPSAreaInformation' => Array(
1797        'gpsTag'       => 0x001C,
1798        'implemented'  => true,
1799        'translatable' => false,
1800        'type'         => self::TYPE_SIMPLE,
1801        'schema'       => "exif",
1802      ),
1803      'exif:GPSDifferential' => Array(
1804        'gpsTag'       => 0x001E,
1805        'implemented'  => true,
1806        'translatable' => false,
1807        'type'         => self::TYPE_SIMPLE,
1808        'schema'       => "exif",
1809      ),
1810
1811      /*
1812       * EXIF Schema for Additional EXIF Properties
1813       */
1814      'xmlns:aux' => Array(
1815        'implemented'  => false,
1816        'translatable' => false,
1817        'type'         => self::TYPE_SIMPLE,
1818        'schema'       => "xmlns",
1819      ),
1820      'aux:Firmware' => Array(
1821        'implemented'  => true,
1822        'translatable' => false,
1823        'type'         => self::TYPE_SIMPLE,
1824        'schema'       => "aux",
1825      ),
1826      'aux:Lens' => Array(
1827        'implemented'  => true,
1828        'translatable' => false,
1829        'type'         => self::TYPE_SIMPLE,
1830        'schema'       => "aux",
1831      ),
1832      'aux:LensID' => Array(
1833        'implemented'  => false,
1834        'translatable' => false,
1835        'type'         => self::TYPE_SIMPLE,
1836        'schema'       => "aux",
1837      ),
1838      'aux:LensInfo' => Array(
1839        'implemented'  => false,
1840        'translatable' => false,
1841        'type'         => self::TYPE_SIMPLE,
1842        'schema'       => "aux",
1843      ),
1844      'aux:SerialNumber' => Array(
1845        'implemented'  => true,
1846        'translatable' => false,
1847        'type'         => self::TYPE_SIMPLE,
1848        'schema'       => "aux",
1849      ),
1850
1851
1852      /*
1853       * IPTC Schema
1854       */
1855      'xmlns:Iptc4xmpCore' => Array(
1856        'implemented'  => false,
1857        'translatable' => false,
1858        'type'         => self::TYPE_SIMPLE,
1859        'schema'       => "xmlns",
1860      ),
1861
1862      'Iptc4xmpCore:CountryCode' => Array(
1863        'iptcTag'      => 0x0264,
1864        'implemented'  => true,
1865        'translatable' => false,
1866        'type'         => self::TYPE_SIMPLE,
1867        'schema'       => "Iptc4xmpCore",
1868      ),
1869
1870      'Iptc4xmpCore:IntellectualGenre' => Array(
1871        'iptcTag'      => 0x0204,
1872        'implemented'  => true,
1873        'translatable' => false,
1874        'type'         => self::TYPE_SIMPLE,
1875        'schema'       => "Iptc4xmpCore",
1876      ),
1877
1878      'Iptc4xmpCore:Scene' => Array(
1879        'implemented'  => true,
1880        'translatable' => true,
1881        'type'         => self::TYPE_BAG,
1882        'schema'       => "Iptc4xmpCore",
1883        'tagValues.special' => Array(
1884          '012100' => "posing",
1885          '012000' => "performing",
1886          '011900' => "action",
1887          '011800' => "close-up",
1888          '011700' => "interior view",
1889          '011600' => "exterior view",
1890          '011500' => "satellite",
1891          '011400' => "night scene",
1892          '011300' => "under-water",
1893          '011200' => "aerial view",
1894          '011100' => "panoramic view",
1895          '011000' => "general view",
1896          '010800' => "two",
1897          '010900' => "group",
1898          '010700' => "couple",
1899          '010600' => "Single",
1900          '010400' => "profile",
1901          '010500' => "rear view",
1902          '010300' => "full-length",
1903          '010200' => "half-length",
1904          '010100' => "headshot",
1905          '012200' => "symbolic",
1906          '012300' => "off-beat",
1907          '012400' => "movie scene",
1908        )
1909      ),
1910
1911      'Iptc4xmpCore:SubjectCode' => Array(
1912        'iptcTag'      => 0x020C,
1913        'implemented'  => true,
1914        'translatable' => false,
1915        'type'         => self::TYPE_BAG,
1916        'schema'       => "Iptc4xmpCore",
1917      ),
1918
1919      'Iptc4xmpCore:Location' => Array(
1920        'iptcTag'      => 0x025C,
1921        'implemented'  => true,
1922        'translatable' => false,
1923        'type'         => self::TYPE_SIMPLE,
1924        'schema'       => "Iptc4xmpCore",
1925      ),
1926
1927      'Iptc4xmpCore:DateCreated' => Array(
1928        'iptcTag'      => 0x0237,
1929        'implemented'  => false,
1930        'translatable' => false,
1931        'type'         => self::TYPE_SIMPLE,
1932        'schema'       => "Iptc4xmpCore",
1933      ),
1934
1935      /*
1936       * specification says :
1937       * "The IPTC Extension Licensor fields should be used instead of these
1938       * Creator's Contact Info fields if you are using IPTC Extension fields.
1939       * If the creator is also the licensor his or her contact information
1940       * should be provided in the Licensor fields."
1941       */
1942      'Iptc4xmpCore:CreatorContactInfo' => Array(
1943        'implemented'  => false,
1944        'translatable' => false,
1945        'type'         => self::TYPE_SIMPLE,
1946        'schema'       => "Iptc4xmpCore",
1947      ),
1948
1949      'Iptc4xmpCore:CiEmailWork' => Array(
1950        'implemented'  => true,
1951        'translatable' => false,
1952        'type'         => self::TYPE_SIMPLE,
1953        'schema'       => "Iptc4xmpCore",
1954      ),
1955
1956      'Iptc4xmpCore:CiUrlWork' => Array(
1957        'implemented'  => true,
1958        'translatable' => false,
1959        'type'         => self::TYPE_SIMPLE,
1960        'schema'       => "Iptc4xmpCore",
1961      ),
1962
1963      'Iptc4xmpCore:CiTelWork' => Array(
1964        'implemented'  => true,
1965        'translatable' => false,
1966        'type'         => self::TYPE_SIMPLE,
1967        'schema'       => "Iptc4xmpCore",
1968      ),
1969
1970      'Iptc4xmpCore:CiAdrExtadr' => Array(
1971        'implemented'  => true,
1972        'translatable' => false,
1973        'type'         => self::TYPE_SIMPLE,
1974        'schema'       => "Iptc4xmpCore",
1975      ),
1976
1977      'Iptc4xmpCore:CiAdrPcode' => Array(
1978        'implemented'  => true,
1979        'translatable' => false,
1980        'type'         => self::TYPE_SIMPLE,
1981        'schema'       => "Iptc4xmpCore",
1982      ),
1983
1984      'Iptc4xmpCore:CiAdrCity' => Array(
1985        'implemented'  => true,
1986        'translatable' => false,
1987        'type'         => self::TYPE_SIMPLE,
1988        'schema'       => "Iptc4xmpCore",
1989      ),
1990
1991      'Iptc4xmpCore:CiAdrCtry' => Array(
1992        'implemented'  => true,
1993        'translatable' => false,
1994        'type'         => self::TYPE_SIMPLE,
1995        'schema'       => "Iptc4xmpCore",
1996      ),
1997
1998      /*
1999       * Note Schema
2000       */
2001      'xmlns:xmpNote' => Array(
2002        'implemented'  => false,
2003        'translatable' => false,
2004        'type'         => self::TYPE_SIMPLE,
2005        'schema'       => "xmlns",
2006      ),
2007
2008      'xmpNote:HasExtendedXMP' => Array(
2009        'implemented'  => false,
2010        'translatable' => false,
2011        'type'         => self::TYPE_SIMPLE,
2012        'schema'       => "xmpNote",
2013      ),
2014
2015    );
2016
2017    /**
2018     * XmpTags needs a specific constructor, allowing to extract exif & iptc
2019     * properties for some tags
2020     *
2021     */
2022    function __construct()
2023    {
2024      parent::__construct();
2025
2026      $tmpTags=Array(
2027        'exifTag' => new IfdTags(),
2028        'gpsTag'  => new GpsTags(),
2029        'iptcTag' => new IptcTags());
2030      foreach($this->tags as $key => $val)
2031      {
2032        foreach($tmpTags as $schema => $tags)
2033        {
2034          if(array_key_exists($schema, $val))
2035          {
2036            /*
2037             * for all the tags from the exif & tiff schema, try to copy properties
2038             */
2039            if($val[$schema]!=0xFFFF and $tags->tagIdExists($val[$schema]))
2040            {
2041              $tmpTag=$tags->getTagById($val[$schema]);
2042            }
2043            else
2044            {
2045              $tmpTag=NULL;
2046            }
2047
2048
2049            if(!is_null($tmpTag))
2050            {
2051              //$this->tags[$key]['tagName'] = $tmpTag['tagName'];
2052
2053              if(array_key_exists('tagValues', $tmpTag))
2054              {
2055                $this->tags[$key]['tagValues'] = $tmpTag['tagValues'];
2056              }
2057
2058              if($val['implemented'] and !$tmpTag['implemented'])
2059              {
2060                $this->tags[$key]['implemented'] = false;
2061              }
2062
2063              unset($tmpTag);
2064            }
2065          }
2066        }
2067      }
2068      unset($tmpTags[0]);
2069      unset($tmpTags[1]);
2070      unset($tmpTags[2]);
2071      unset($tmpTags);
2072    }
2073
2074
2075    function __destruct()
2076    {
2077      parent::__destruct();
2078    }
2079  }
2080
2081
2082?>
Note: See TracBrowser for help on using the repository browser.