04a957c11ef47f85efc9fc0f91f5c5b8fa256ec3
[yaffs-website] / lsolesen / pel / src / PelTag.php
1 <?php
2
3 /**
4  * PEL: PHP Exif Library.
5  * A library with support for reading and
6  * writing all Exif headers in JPEG and TIFF images using PHP.
7  *
8  * Copyright (C) 2004, 2005, 2006, 2007 Martin Geisler.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program in the file COPYING; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301 USA
24  */
25 namespace lsolesen\pel;
26
27     /**
28      * Namespace for functions operating on Exif tags.
29      *
30      * @author Martin Geisler <mgeisler@users.sourceforge.net>
31      * @license http://www.gnu.org/licenses/gpl.html GNU General Public
32      *          License (GPL)
33      * @package PEL
34      */
35
36 /**
37  * Class with static methods for Exif tags.
38  *
39  * This class defines the constants that represents the Exif tags
40  * known to PEL. They are supposed to be used whenever one needs to
41  * specify an Exif tag, and they will be denoted by the pseudo-type
42  * {@link PelTag} throughout the documentation.
43  *
44  * Please note that the constrains on the format and number of
45  * components given here are advisory only. To follow the Exif
46  * specification one should obey them, but there is nothing that
47  * prevents you from creating an {@link IMAGE_LENGTH} entry with two
48  * or more components, even though the standard says that there should
49  * be exactly one component.
50  *
51  * All the methods in this class are static and should be called with
52  * the Exif tag on which they should operate.
53  *
54  * @author Martin Geisler <mgeisler@users.sourceforge.net>
55  * @package PEL
56  */
57 class PelTag
58 {
59
60     /**
61      * Interoperability index.
62      *
63      * Format: {@link PelFormat::ASCII}.
64      *
65      * Components: 4.
66      */
67     const INTEROPERABILITY_INDEX = 0x0001;
68
69     /**
70      * Interoperability version.
71      *
72      * Format: {@link PelFormat::UNDEFINED}.
73      *
74      * Components: 4.
75      */
76     const INTEROPERABILITY_VERSION = 0x0002;
77
78     /**
79      * Image width.
80      *
81      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
82      *
83      * Components: 1.
84      */
85     const IMAGE_WIDTH = 0x0100;
86
87     /**
88      * Image length.
89      *
90      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
91      *
92      * Components: 1.
93      */
94     const IMAGE_LENGTH = 0x0101;
95
96     /**
97      * Number of bits per component.
98      *
99      * Format: {@link PelFormat::SHORT}.
100      *
101      * Components: 3.
102      */
103     const BITS_PER_SAMPLE = 0x0102;
104
105     /**
106      * Compression scheme.
107      *
108      * Format: {@link PelFormat::SHORT}.
109      *
110      * Components: 1.
111      */
112     const COMPRESSION = 0x0103;
113
114     /**
115      * Pixel composition.
116      *
117      * Format: {@link PelFormat::SHORT}.
118      *
119      * Components: 1.
120      */
121     const PHOTOMETRIC_INTERPRETATION = 0x0106;
122
123     /**
124      * Fill Order
125      *
126      * Format: Unknown.
127      *
128      * Components: Unknown.
129      */
130     const FILL_ORDER = 0x010A;
131
132     /**
133      * Document Name
134      *
135      * Format: {@link PelEntryAscii}.
136      *
137      * Components: any number.
138      */
139     const DOCUMENT_NAME = 0x010D;
140
141     /**
142      * Image Description
143      *
144      * Format: {@link PelEntryAscii}.
145      *
146      * Components: any number.
147      */
148     const IMAGE_DESCRIPTION = 0x010E;
149
150     /**
151      * Manufacturer
152      *
153      * Format: {@link PelEntryAscii}.
154      *
155      * Components: any number.
156      */
157     const MAKE = 0x010F;
158
159     /**
160      * Model
161      *
162      * Format: {@link PelFormat::ASCII}.
163      *
164      * Components: any number.
165      */
166     const MODEL = 0x0110;
167
168     /**
169      * Strip Offsets
170      *
171      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
172      *
173      * Components: any number.
174      */
175     const STRIP_OFFSETS = 0x0111;
176
177     /**
178      * Orientation of image.
179      *
180      * Format: {@link PelFormat::SHORT}.
181      *
182      * Components: 1.
183      */
184     const ORIENTATION = 0x0112;
185
186     /**
187      * Number of components.
188      *
189      * Format: {@link PelFormat::SHORT}.
190      *
191      * Components: 1.
192      */
193     const SAMPLES_PER_PIXEL = 0x0115;
194
195     /**
196      * Rows per Strip
197      *
198      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
199      *
200      * Components: 1.
201      */
202     const ROWS_PER_STRIP = 0x0116;
203
204     /**
205      * Strip Byte Count
206      *
207      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
208      *
209      * Components: any number.
210      */
211     const STRIP_BYTE_COUNTS = 0x0117;
212
213     /**
214      * Image resolution in width direction.
215      *
216      * Format: {@link PelFormat::RATIONAL}.
217      *
218      * Components: 1.
219      */
220     const X_RESOLUTION = 0x011A;
221
222     /**
223      * Image resolution in height direction.
224      *
225      * Format: {@link PelFormat::RATIONAL}.
226      *
227      * Components: 1.
228      */
229     const Y_RESOLUTION = 0x011B;
230
231     /**
232      * Image data arrangement.
233      *
234      * Format: {@link PelFormat::SHORT}.
235      *
236      * Components: 1.
237      */
238     const PLANAR_CONFIGURATION = 0x011C;
239
240     /**
241      * Unit of X and Y resolution.
242      *
243      * Format: {@link PelFormat::SHORT}.
244      *
245      * Components: 1.
246      */
247     const RESOLUTION_UNIT = 0x0128;
248
249     /**
250      * Transfer function.
251      *
252      * Format: {@link PelFormat::SHORT}.
253      *
254      * Components: 3.
255      */
256     const TRANSFER_FUNCTION = 0x012D;
257
258     /**
259      * Software used.
260      *
261      * Format: {@link PelFormat::ASCII}.
262      *
263      * Components: any number.
264      */
265     const SOFTWARE = 0x0131;
266
267     /**
268      * File change date and time.
269      *
270      * Format: {@link PelFormat::ASCII}, modelled by the {@link
271      * PelEntryTime} class.
272      *
273      * Components: 20.
274      */
275     const DATE_TIME = 0x0132;
276
277     /**
278      * Person who created the image.
279      *
280      * Format: {@link PelFormat::ASCII}.
281      *
282      * Components: any number.
283      */
284     const ARTIST = 0x013B;
285
286     /**
287      * White point chromaticity.
288      *
289      * Format: {@link PelFormat::RATIONAL}.
290      *
291      * Components: 2.
292      */
293     const WHITE_POINT = 0x013E;
294
295     /**
296      * Chromaticities of primaries.
297      *
298      * Format: {@link PelFormat::RATIONAL}.
299      *
300      * Components: 6.
301      */
302     const PRIMARY_CHROMATICITIES = 0x013F;
303
304     /**
305      * Transfer Range
306      *
307      * Format: Unknown.
308      *
309      * Components: Unknown.
310      */
311     const TRANSFER_RANGE = 0x0156;
312
313     /**
314      * JPEGProc
315      *
316      * Format: Unknown.
317      *
318      * Components: Unknown.
319      */
320     const JPEG_PROC = 0x0200;
321
322     /**
323      * Offset to JPEG SOI.
324      *
325      * Format: {@link PelFormat::LONG}.
326      *
327      * Components: 1.
328      */
329     const JPEG_INTERCHANGE_FORMAT = 0x0201;
330
331     /**
332      * Bytes of JPEG data.
333      *
334      * Format: {@link PelFormat::LONG}.
335      *
336      * Components: 1.
337      */
338     const JPEG_INTERCHANGE_FORMAT_LENGTH = 0x0202;
339
340     /**
341      * Color space transformation matrix coefficients.
342      *
343      * Format: {@link PelFormat::RATIONAL}.
344      *
345      * Components: 3.
346      */
347     const YCBCR_COEFFICIENTS = 0x0211;
348
349     /**
350      * Subsampling ratio of Y to C.
351      *
352      * Format: {@link PelFormat::SHORT}.
353      *
354      * Components: 2.
355      */
356     const YCBCR_SUB_SAMPLING = 0x0212;
357
358     /**
359      * Y and C positioning.
360      *
361      * Format: {@link PelFormat::SHORT}.
362      *
363      * Components: 1.
364      */
365     const YCBCR_POSITIONING = 0x0213;
366
367     /**
368      * Pair of black and white reference values.
369      *
370      * Format: {@link PelFormat::RATIONAL}.
371      *
372      * Components: 6.
373      */
374     const REFERENCE_BLACK_WHITE = 0x0214;
375
376     /**
377      * Related Image File Format
378      *
379      * Format: Unknown.
380      *
381      * Components: Unknown.
382      */
383     const RELATED_IMAGE_FILE_FORMAT = 0x1000;
384
385     /**
386      * Related Image Width
387      *
388      * Format: Unknown, probably {@link PelFormat::SHORT}?
389      *
390      * Components: Unknown, probably 1.
391      */
392     const RELATED_IMAGE_WIDTH = 0x1001;
393
394     /**
395      * Related Image Length
396      *
397      * Format: Unknown, probably {@link PelFormat::SHORT}?
398      *
399      * Components: Unknown, probably 1.
400      */
401     const RELATED_IMAGE_LENGTH = 0x1002;
402
403     /**
404      * Rating
405      *
406      * Format: {@link PelFormat::SHORT}
407      *
408      * Components: 1.
409     */
410     const RATING = 0x4746;
411
412     /**
413      * CFA Repeat Pattern Dim.
414      *
415      * Format: {@link PelFormat::SHORT}.
416      *
417      * Components: 2.
418      */
419     const CFA_REPEAT_PATTERN_DIM = 0x828D;
420
421     /**
422      * Battery level.
423      *
424      * Format: Unknown.
425      *
426      * Components: Unknown.
427      */
428     const BATTERY_LEVEL = 0x828F;
429
430     /**
431      * Copyright holder.
432      *
433      * Format: {@link PelFormat::ASCII}, modelled by the {@link
434      * PelEntryCopyright} class.
435      *
436      * Components: any number.
437      */
438     const COPYRIGHT = 0x8298;
439
440     /**
441      * Exposure Time
442      *
443      * Format: {@link PelFormat::RATIONAL}.
444      *
445      * Components: 1.
446      */
447     const EXPOSURE_TIME = 0x829A;
448
449     /**
450      * FNumber
451      *
452      * Format: {@link PelFormat::RATIONAL}.
453      *
454      * Components: 1.
455      */
456     const FNUMBER = 0x829D;
457
458     /**
459      * IPTC/NAA
460      *
461      * Format: {@link PelFormat::LONG}.
462      *
463      * Components: any number.
464      */
465     const IPTC_NAA = 0x83BB;
466
467     /**
468      * Exif IFD Pointer
469      *
470      * Format: {@link PelFormat::LONG}.
471      *
472      * Components: 1.
473      */
474     const EXIF_IFD_POINTER = 0x8769;
475
476     /**
477      * Inter Color Profile
478      *
479      * Format: {@link PelFormat::UNDEFINED}.
480      *
481      * Components: any number.
482      */
483     const INTER_COLOR_PROFILE = 0x8773;
484
485     /**
486      * Exposure Program
487      *
488      * Format: {@link PelFormat::SHORT}.
489      *
490      * Components: 1.
491      */
492     const EXPOSURE_PROGRAM = 0x8822;
493
494     /**
495      * Spectral Sensitivity
496      *
497      * Format: {@link PelFormat::ASCII}.
498      *
499      * Components: any number.
500      */
501     const SPECTRAL_SENSITIVITY = 0x8824;
502
503     /**
504      * GPS Info IFD Pointer
505      *
506      * Format: {@link PelFormat::LONG}.
507      *
508      * Components: 1.
509      */
510     const GPS_INFO_IFD_POINTER = 0x8825;
511
512     /**
513      * ISO Speed Ratings
514      *
515      * Format: {@link PelFormat::SHORT}.
516      *
517      * Components: 2.
518      */
519     const ISO_SPEED_RATINGS = 0x8827;
520
521     /**
522      * OECF
523      *
524      * Format: {@link PelFormat::UNDEFINED}.
525      *
526      * Components: any number.
527      */
528     const OECF = 0x8828;
529
530     /**
531      * Exif version.
532      *
533      * Format: {@link PelFormat::UNDEFINED}, modelled by the {@link
534      * PelEntryVersion} class.
535      *
536      * Components: 4.
537      */
538     const EXIF_VERSION = 0x9000;
539
540     /**
541      * Date and time of original data generation.
542      *
543      * Format: {@link PelFormat::ASCII}, modelled by the {@link
544      * PelEntryTime} class.
545      *
546      * Components: 20.
547      */
548     const DATE_TIME_ORIGINAL = 0x9003;
549
550     /**
551      * Date and time of digital data generation.
552      *
553      * Format: {@link PelFormat::ASCII}, modelled by the {@link
554      * PelEntryTime} class.
555      *
556      * Components: 20.
557      */
558     const DATE_TIME_DIGITIZED = 0x9004;
559
560     /**
561      * Meaning of each component.
562      *
563      * Format: {@link PelFormat::UNDEFINED}.
564      *
565      * Components: 4.
566      */
567     const COMPONENTS_CONFIGURATION = 0x9101;
568
569     /**
570      * Image compression mode.
571      *
572      * Format: {@link PelFormat::RATIONAL}.
573      *
574      * Components: 1.
575      */
576     const COMPRESSED_BITS_PER_PIXEL = 0x9102;
577
578     /**
579      * Shutter speed
580      *
581      * Format: {@link PelFormat::SRATIONAL}.
582      *
583      * Components: 1.
584      */
585     const SHUTTER_SPEED_VALUE = 0x9201;
586
587     /**
588      * Aperture
589      *
590      * Format: {@link PelFormat::RATIONAL}.
591      *
592      * Components: 1.
593      */
594     const APERTURE_VALUE = 0x9202;
595
596     /**
597      * Brightness
598      *
599      * Format: {@link PelFormat::SRATIONAL}.
600      *
601      * Components: 1.
602      */
603     const BRIGHTNESS_VALUE = 0x9203;
604
605     /**
606      * Exposure Bias
607      *
608      * Format: {@link PelFormat::SRATIONAL}.
609      *
610      * Components: 1.
611      */
612     const EXPOSURE_BIAS_VALUE = 0x9204;
613
614     /**
615      * Max Aperture Value
616      *
617      * Format: {@link PelFormat::RATIONAL}.
618      *
619      * Components: 1.
620      */
621     const MAX_APERTURE_VALUE = 0x9205;
622
623     /**
624      * Subject Distance
625      *
626      * Format: {@link PelFormat::SRATIONAL}.
627      *
628      * Components: 1.
629      */
630     const SUBJECT_DISTANCE = 0x9206;
631
632     /**
633      * Metering Mode
634      *
635      * Format: {@link PelFormat::SHORT}.
636      *
637      * Components: 1.
638      */
639     const METERING_MODE = 0x9207;
640
641     /**
642      * Light Source
643      *
644      * Format: {@link PelFormat::SHORT}.
645      *
646      * Components: 1.
647      */
648     const LIGHT_SOURCE = 0x9208;
649
650     /**
651      * Flash
652      *
653      * Format: {@link PelFormat::SHORT}.
654      *
655      * Components: 1.
656      */
657     const FLASH = 0x9209;
658
659     /**
660      * Focal Length
661      *
662      * Format: {@link PelFormat::RATIONAL}.
663      *
664      * Components: 1.
665      */
666     const FOCAL_LENGTH = 0x920A;
667
668     /**
669      * Subject Area
670      *
671      * Format: {@link PelFormat::SHORT}.
672      *
673      * Components: 4.
674      */
675     const SUBJECT_AREA = 0x9214;
676
677     /**
678      * Maker Note
679      *
680      * Format: {@link PelFormat::UNDEFINED}.
681      *
682      * Components: any number.
683      */
684     const MAKER_NOTE = 0x927C;
685
686     /**
687      * User Comment
688      *
689      * Format: {@link PelFormat::UNDEFINED}, modelled by the {@link
690      * PelEntryUserComment} class.
691      *
692      * Components: any number.
693      */
694     const USER_COMMENT = 0x9286;
695
696     /**
697      * SubSec Time
698      *
699      * Format: {@link PelFormat::ASCII}.
700      *
701      * Components: any number.
702      */
703     const SUB_SEC_TIME = 0x9290;
704
705     /**
706      * SubSec Time Original
707      *
708      * Format: {@link PelFormat::ASCII}.
709      *
710      * Components: any number.
711      */
712     const SUB_SEC_TIME_ORIGINAL = 0x9291;
713
714     /**
715      * SubSec Time Digitized
716      *
717      * Format: {@link PelFormat::ASCII}.
718      *
719      * Components: any number.
720      */
721     const SUB_SEC_TIME_DIGITIZED = 0x9292;
722
723     /**
724      * Windows XP Title
725      *
726      * Format: {@link PelFormat::BYTE}, modelled by the
727      * {@link PelEntryWindowsString} class.
728      *
729      * Components: any number.
730      */
731     const XP_TITLE = 0x9C9B;
732
733     /**
734      * Windows XP Comment
735      *
736      * Format: {@link PelFormat::BYTE}, modelled by the
737      * {@link PelEntryWindowsString} class.
738      *
739      * Components: any number.
740      */
741     const XP_COMMENT = 0x9C9C;
742
743     /**
744      * Windows XP Author
745      *
746      * Format: {@link PelFormat::BYTE}, modelled by the
747      * {@link PelEntryWindowsString} class.
748      *
749      * Components: any number.
750      */
751     const XP_AUTHOR = 0x9C9D;
752
753     /**
754      * Windows XP Keywords
755      *
756      * Format: {@link PelFormat::BYTE}, modelled by the
757      * {@link PelEntryWindowsString} class.
758      *
759      * Components: any number.
760      */
761     const XP_KEYWORDS = 0x9C9E;
762
763     /**
764      * Windows XP Subject
765      *
766      * Format: {@link PelFormat::BYTE}, modelled by the
767      * {@link PelEntryWindowsString} class.
768      *
769      * Components: any number.
770      */
771     const XP_SUBJECT = 0x9C9F;
772
773     /**
774      * Supported Flashpix version
775      *
776      * Format: {@link PelFormat::UNDEFINED}, modelled by the {@link
777      * PelEntryVersion} class.
778      *
779      * Components: 4.
780      */
781     const FLASH_PIX_VERSION = 0xA000;
782
783     /**
784      * Color space information.
785      *
786      * Format: {@link PelFormat::SHORT}.
787      *
788      * Components: 1.
789      */
790     const COLOR_SPACE = 0xA001;
791
792     /**
793      * Valid image width.
794      *
795      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
796      *
797      * Components: 1.
798      */
799     const PIXEL_X_DIMENSION = 0xA002;
800
801     /**
802      * Valid image height.
803      *
804      * Format: {@link PelFormat::SHORT} or {@link PelFormat::LONG}.
805      *
806      * Components: 1.
807      */
808     const PIXEL_Y_DIMENSION = 0xA003;
809
810     /**
811      * Related audio file.
812      *
813      * Format: {@link PelFormat::ASCII}.
814      *
815      * Components: any number.
816      */
817     const RELATED_SOUND_FILE = 0xA004;
818
819     /**
820      * Interoperability IFD Pointer
821      *
822      * Format: {@link PelFormat::LONG}.
823      *
824      * Components: 1.
825      */
826     const INTEROPERABILITY_IFD_POINTER = 0xA005;
827
828     /**
829      * Flash energy.
830      *
831      * Format: {@link PelFormat::RATIONAL}.
832      *
833      * Components: 1.
834      */
835     const FLASH_ENERGY = 0xA20B;
836
837     /**
838      * Spatial frequency response.
839      *
840      * Format: {@link PelFormat::UNDEFINED}.
841      *
842      * Components: any number.
843      */
844     const SPATIAL_FREQUENCY_RESPONSE = 0xA20C;
845
846     /**
847      * Focal plane X resolution.
848      *
849      * Format: {@link PelFormat::RATIONAL}.
850      *
851      * Components: 1.
852      */
853     const FOCAL_PLANE_X_RESOLUTION = 0xA20E;
854
855     /**
856      * Focal plane Y resolution.
857      *
858      * Format: {@link PelFormat::RATIONAL}.
859      *
860      * Components: 1.
861      */
862     const FOCAL_PLANE_Y_RESOLUTION = 0xA20F;
863
864     /**
865      * Focal plane resolution unit.
866      *
867      * Format: {@link PelFormat::SHORT}.
868      *
869      * Components: 1.
870      */
871     const FOCAL_PLANE_RESOLUTION_UNIT = 0xA210;
872
873     /**
874      * Subject location.
875      *
876      * Format: {@link PelFormat::SHORT}.
877      *
878      * Components: 1.
879      */
880     const SUBJECT_LOCATION = 0xA214;
881
882     /**
883      * Exposure index.
884      *
885      * Format: {@link PelFormat::RATIONAL}.
886      *
887      * Components: 1.
888      */
889     const EXPOSURE_INDEX = 0xA215;
890
891     /**
892      * Sensing method.
893      *
894      * Format: {@link PelFormat::SHORT}.
895      *
896      * Components: 1.
897      */
898     const SENSING_METHOD = 0xA217;
899
900     /**
901      * File source.
902      *
903      * Format: {@link PelFormat::UNDEFINED}.
904      *
905      * Components: 1.
906      */
907     const FILE_SOURCE = 0xA300;
908
909     /**
910      * Scene type.
911      *
912      * Format: {@link PelFormat::UNDEFINED}.
913      *
914      * Components: 1.
915      */
916     const SCENE_TYPE = 0xA301;
917
918     /**
919      * CFA pattern.
920      *
921      * Format: {@link PelFormat::UNDEFINED}.
922      *
923      * Components: any number.
924      */
925     const CFA_PATTERN = 0xA302;
926
927     /**
928      * Custom image processing.
929      *
930      * Format: {@link PelFormat::SHORT}.
931      *
932      * Components: 1.
933      */
934     const CUSTOM_RENDERED = 0xA401;
935
936     /**
937      * Exposure mode.
938      *
939      * Format: {@link PelFormat::SHORT}.
940      *
941      * Components: 1.
942      */
943     const EXPOSURE_MODE = 0xA402;
944
945     /**
946      * White balance.
947      *
948      * Format: {@link PelFormat::SHORT}.
949      *
950      * Components: 1.
951      */
952     const WHITE_BALANCE = 0xA403;
953
954     /**
955      * Digital zoom ratio.
956      *
957      * Format: {@link PelFormat::RATIONAL}.
958      *
959      * Components: 1.
960      */
961     const DIGITAL_ZOOM_RATIO = 0xA404;
962
963     /**
964      * Focal length in 35mm film.
965      *
966      * Format: {@link PelFormat::RATIONAL}.
967      *
968      * Components: 1.
969      */
970     const FOCAL_LENGTH_IN_35MM_FILM = 0xA405;
971
972     /**
973      * Scene capture type.
974      *
975      * Format: {@link PelFormat::SHORT}.
976      *
977      * Components: 1.
978      */
979     const SCENE_CAPTURE_TYPE = 0xA406;
980
981     /**
982      * Gain control.
983      *
984      * Format: {@link PelFormat::SHORT}.
985      *
986      * Components: 1.
987      */
988     const GAIN_CONTROL = 0xA407;
989
990     /**
991      * Contrast.
992      *
993      * Format: {@link PelFormat::SHORT}.
994      *
995      * Components: 1.
996      */
997     const CONTRAST = 0xA408;
998
999     /**
1000      * Saturation.
1001      *
1002      * Format: {@link PelFormat::SHORT}.
1003      *
1004      * Components: 1.
1005      */
1006     const SATURATION = 0xA409;
1007
1008     /**
1009      * Sharpness.
1010      *
1011      * Format: {@link PelFormat::SHORT}.
1012      *
1013      * Components: 1.
1014      */
1015     const SHARPNESS = 0xA40A;
1016
1017     /**
1018      * Device settings description.
1019      *
1020      * This tag indicates information on the picture-taking conditions
1021      * of a particular camera model. The tag is used only to indicate
1022      * the picture-taking conditions in the reader.
1023      */
1024     const DEVICE_SETTING_DESCRIPTION = 0xA40B;
1025
1026     /**
1027      * Subject distance range.
1028      *
1029      * Format: {@link PelFormat::SHORT}.
1030      *
1031      * Components: 1.
1032      */
1033     const SUBJECT_DISTANCE_RANGE = 0xA40C;
1034
1035     /**
1036      * Image unique ID.
1037      *
1038      * Format: {@link PelFormat::ASCII}.
1039      *
1040      * Components: 32.
1041      */
1042     const IMAGE_UNIQUE_ID = 0xA420;
1043
1044     /**
1045      * Gamma.
1046      *
1047      * Format: {@link PelFormat::RATIONAL}.
1048      *
1049      * Components: 1.
1050      */
1051     const GAMMA = 0xA500;
1052
1053     /**
1054      * PrintIM
1055      *
1056      * Format: {@link PelFormat::UNDEFINED}.
1057      *
1058      * Components: unknown.
1059      */
1060     const PRINT_IM = 0xC4A5;
1061
1062     /**
1063      * GPS tag version.
1064      *
1065      * Format: {@link PelFormat::BYTE}.
1066      *
1067      * Components: 4.
1068      */
1069     const GPS_VERSION_ID = 0x0000;
1070
1071     /**
1072      * North or South Latitude.
1073      *
1074      * Format: {@link PelFormat::ASCII}.
1075      *
1076      * Components: 2.
1077      */
1078     const GPS_LATITUDE_REF = 0x0001;
1079
1080     /**
1081      * Latitude.
1082      *
1083      * Format: {@link PelFormat::RATIONAL}.
1084      *
1085      * Components: 3.
1086      */
1087     const GPS_LATITUDE = 0x0002;
1088
1089     /**
1090      * East or West Longitude.
1091      *
1092      * Format: {@link PelFormat::ASCII}.
1093      *
1094      * Components: 2.
1095      */
1096     const GPS_LONGITUDE_REF = 0x0003;
1097
1098     /**
1099      * Longitude.
1100      *
1101      * Format: {@link PelFormat::RATIONAL}.
1102      *
1103      * Components: 3.
1104      */
1105     const GPS_LONGITUDE = 0x0004;
1106
1107     /**
1108      * Altitude reference.
1109      *
1110      * Format: {@link PelFormat::BYTE}.
1111      *
1112      * Components: 1.
1113      */
1114     const GPS_ALTITUDE_REF = 0x0005;
1115
1116     /**
1117      * Altitude.
1118      *
1119      * Format: {@link PelFormat::RATIONAL}.
1120      *
1121      * Components: 1.
1122      */
1123     const GPS_ALTITUDE = 0x0006;
1124
1125     /**
1126      * GPS time (atomic clock).
1127      *
1128      * Format: {@link PelFormat::RATIONAL}.
1129      *
1130      * Components: 3.
1131      */
1132     const GPS_TIME_STAMP = 0x0007;
1133
1134     /**
1135      * GPS satellites used for measurement.
1136      *
1137      * Format: {@link PelFormat::ASCII}.
1138      *
1139      * Components: Any.
1140      */
1141     const GPS_SATELLITES = 0x0008;
1142
1143     /**
1144      * GPS receiver status.
1145      *
1146      * Format: {@link PelFormat::ASCII}.
1147      *
1148      * Components: 2.
1149      */
1150     const GPS_STATUS = 0x0009;
1151
1152     /**
1153      * GPS measurement mode.
1154      *
1155      * Format: {@link PelFormat::ASCII}.
1156      *
1157      * Components: 2.
1158      */
1159     const GPS_MEASURE_MODE = 0x000A;
1160
1161     /**
1162      * Measurement precision.
1163      *
1164      * Format: {@link PelFormat::RATIONAL}.
1165      *
1166      * Components: 1.
1167      */
1168     const GPS_DOP = 0x000B;
1169
1170     /**
1171      * Speed unit.
1172      *
1173      * Format: {@link PelFormat::ASCII}.
1174      *
1175      * Components: 2.
1176      */
1177     const GPS_SPEED_REF = 0x000C;
1178
1179     /**
1180      * Speed of GPS receiver.
1181      *
1182      * Format: {@link PelFormat::RATIONAL}.
1183      *
1184      * Components: 1.
1185      */
1186     const GPS_SPEED = 0x000D;
1187
1188     /**
1189      * Reference for direction of movement.
1190      *
1191      * Format: {@link PelFormat::ASCII}.
1192      *
1193      * Components: 2.
1194      */
1195     const GPS_TRACK_REF = 0x000E;
1196
1197     /**
1198      * Direction of movement.
1199      *
1200      * Format: {@link PelFormat::RATIONAL}.
1201      *
1202      * Components: 1.
1203      */
1204     const GPS_TRACK = 0x000F;
1205
1206     /**
1207      * Reference for direction of image.
1208      *
1209      * Format: {@link PelFormat::ASCII}.
1210      *
1211      * Components: 2.
1212      */
1213     const GPS_IMG_DIRECTION_REF = 0x0010;
1214
1215     /**
1216      * Direction of image.
1217      *
1218      * Format: {@link PelFormat::RATIONAL}.
1219      *
1220      * Components: 1.
1221      */
1222     const GPS_IMG_DIRECTION = 0x0011;
1223
1224     /**
1225      * Geodetic survey data used.
1226      *
1227      * Format: {@link PelFormat::ASCII}.
1228      *
1229      * Components: Any.
1230      */
1231     const GPS_MAP_DATUM = 0x0012;
1232
1233     /**
1234      * Reference for latitude of destination.
1235      *
1236      * Format: {@link PelFormat::ASCII}.
1237      *
1238      * Components: 2.
1239      */
1240     const GPS_DEST_LATITUDE_REF = 0x0013;
1241
1242     /**
1243      * Latitude of destination.
1244      *
1245      * Format: {@link PelFormat::RATIONAL}.
1246      *
1247      * Components: 3.
1248      */
1249     const GPS_DEST_LATITUDE = 0x0014;
1250
1251     /**
1252      * Reference for longitude of destination.
1253      *
1254      * Format: {@link PelFormat::ASCII}.
1255      *
1256      * Components: 2.
1257      */
1258     const GPS_DEST_LONGITUDE_REF = 0x0015;
1259
1260     /**
1261      * Longitude of destination.
1262      *
1263      * Format: {@link PelFormat::RATIONAL}.
1264      *
1265      * Components: 3.
1266      */
1267     const GPS_DEST_LONGITUDE = 0x0016;
1268
1269     /**
1270      * Reference for bearing of destination.
1271      *
1272      * Format: {@link PelFormat::ASCII}.
1273      *
1274      * Components: 2.
1275      */
1276     const GPS_DEST_BEARING_REF = 0x0017;
1277
1278     /**
1279      * Bearing of destination.
1280      *
1281      * Format: {@link PelFormat::RATIONAL}.
1282      *
1283      * Components: 1.
1284      */
1285     const GPS_DEST_BEARING = 0x0018;
1286
1287     /**
1288      * Reference for distance to destination.
1289      *
1290      * Format: {@link PelFormat::ASCII}.
1291      *
1292      * Components: 2.
1293      */
1294     const GPS_DEST_DISTANCE_REF = 0x0019;
1295
1296     /**
1297      * Distance to destination.
1298      *
1299      * Format: {@link PelFormat::RATIONAL}.
1300      *
1301      * Components: 1.
1302      */
1303     const GPS_DEST_DISTANCE = 0x001A;
1304
1305     /**
1306      * Name of GPS processing method.
1307      *
1308      * Format: {@link PelFormat::UNDEFINED}.
1309      *
1310      * Components: Any.
1311      */
1312     const GPS_PROCESSING_METHOD = 0x001B;
1313
1314     /**
1315      * Name of GPS area.
1316      *
1317      * Format: {@link PelFormat::UNDEFINED}.
1318      *
1319      * Components: Any.
1320      */
1321     const GPS_AREA_INFORMATION = 0x001C;
1322
1323     /**
1324      * GPS date.
1325      *
1326      * Format: {@link PelFormat::ASCII}.
1327      *
1328      * Components: 11.
1329      */
1330     const GPS_DATE_STAMP = 0x001D;
1331
1332     /**
1333      * GPS differential correction.
1334      *
1335      * Format: {@link PelFormat::SHORT}.
1336      *
1337      * Components: 1.
1338      */
1339     const GPS_DIFFERENTIAL = 0x001E;
1340
1341     /**
1342      * Values for tags short names.
1343      */
1344     protected static $exifTagsShort= array(
1345         self::INTEROPERABILITY_INDEX         => 'InteroperabilityIndex',
1346         self::INTEROPERABILITY_VERSION       => 'InteroperabilityVersion',
1347         self::IMAGE_WIDTH                    => 'ImageWidth',
1348         self::IMAGE_LENGTH                   => 'ImageLength',
1349         self::BITS_PER_SAMPLE                => 'BitsPerSample',
1350         self::COMPRESSION                    => 'Compression',
1351         self::PHOTOMETRIC_INTERPRETATION     => 'PhotometricInterpretation',
1352         self::FILL_ORDER                     => 'FillOrder',
1353         self::DOCUMENT_NAME                  => 'DocumentName',
1354         self::IMAGE_DESCRIPTION              => 'ImageDescription',
1355         self::MAKE                           => 'Make',
1356         self::MODEL                          => 'Model',
1357         self::STRIP_OFFSETS                  => 'StripOffsets',
1358         self::ORIENTATION                    => 'Orientation',
1359         self::SAMPLES_PER_PIXEL              => 'SamplesPerPixel',
1360         self::ROWS_PER_STRIP                 => 'RowsPerStrip',
1361         self::STRIP_BYTE_COUNTS              => 'StripByteCounts',
1362         self::X_RESOLUTION                   => 'XResolution',
1363         self::Y_RESOLUTION                   => 'YResolution',
1364         self::PLANAR_CONFIGURATION           => 'PlanarConfiguration',
1365         self::RESOLUTION_UNIT                => 'ResolutionUnit',
1366         self::TRANSFER_FUNCTION              => 'TransferFunction',
1367         self::SOFTWARE                       => 'Software',
1368         self::DATE_TIME                      => 'DateTime',
1369         self::ARTIST                         => 'Artist',
1370         self::WHITE_POINT                    => 'WhitePoint',
1371         self::PRIMARY_CHROMATICITIES         => 'PrimaryChromaticities',
1372         self::TRANSFER_RANGE                 => 'TransferRange',
1373         self::JPEG_PROC                      => 'JPEGProc',
1374         self::JPEG_INTERCHANGE_FORMAT        => 'JPEGInterchangeFormat',
1375         self::JPEG_INTERCHANGE_FORMAT_LENGTH => 'JPEGInterchangeFormatLength',
1376         self::YCBCR_COEFFICIENTS             => 'YCbCrCoefficients',
1377         self::YCBCR_SUB_SAMPLING             => 'YCbCrSubSampling',
1378         self::YCBCR_POSITIONING              => 'YCbCrPositioning',
1379         self::REFERENCE_BLACK_WHITE          => 'ReferenceBlackWhite',
1380         self::RELATED_IMAGE_FILE_FORMAT      => 'RelatedImageFileFormat',
1381         self::RELATED_IMAGE_WIDTH            => 'RelatedImageWidth',
1382         self::RELATED_IMAGE_LENGTH           => 'RelatedImageLength',
1383         self::RATING                         => 'Rating',
1384         self::CFA_REPEAT_PATTERN_DIM         => 'CFARepeatPatternDim',
1385         self::CFA_PATTERN                    => 'CFAPattern',
1386         self::BATTERY_LEVEL                  => 'BatteryLevel',
1387         self::COPYRIGHT                      => 'Copyright',
1388         self::EXPOSURE_TIME                  => 'ExposureTime',
1389         self::FNUMBER                        => 'FNumber',
1390         self::IPTC_NAA                       => 'IPTC/NAA',
1391         self::EXIF_IFD_POINTER               => 'ExifIFDPointer',
1392         self::INTER_COLOR_PROFILE            => 'InterColorProfile',
1393         self::EXPOSURE_PROGRAM               => 'ExposureProgram',
1394         self::SPECTRAL_SENSITIVITY           => 'SpectralSensitivity',
1395         self::GPS_INFO_IFD_POINTER           => 'GPSInfoIFDPointer',
1396         self::ISO_SPEED_RATINGS              => 'ISOSpeedRatings',
1397         self::OECF                           => 'OECF',
1398         self::EXIF_VERSION                   => 'ExifVersion',
1399         self::DATE_TIME_ORIGINAL             => 'DateTimeOriginal',
1400         self::DATE_TIME_DIGITIZED            => 'DateTimeDigitized',
1401         self::COMPONENTS_CONFIGURATION       => 'ComponentsConfiguration',
1402         self::COMPRESSED_BITS_PER_PIXEL      => 'CompressedBitsPerPixel',
1403         self::SHUTTER_SPEED_VALUE            => 'ShutterSpeedValue',
1404         self::APERTURE_VALUE                 => 'ApertureValue',
1405         self::BRIGHTNESS_VALUE               => 'BrightnessValue',
1406         self::EXPOSURE_BIAS_VALUE            => 'ExposureBiasValue',
1407         self::MAX_APERTURE_VALUE             => 'MaxApertureValue',
1408         self::SUBJECT_DISTANCE               => 'SubjectDistance',
1409         self::METERING_MODE                  => 'MeteringMode',
1410         self::LIGHT_SOURCE                   => 'LightSource',
1411         self::FLASH                          => 'Flash',
1412         self::FOCAL_LENGTH                   => 'FocalLength',
1413         self::MAKER_NOTE                     => 'MakerNote',
1414         self::USER_COMMENT                   => 'UserComment',
1415         self::SUB_SEC_TIME                   => 'SubSecTime',
1416         self::SUB_SEC_TIME_ORIGINAL          => 'SubSecTimeOriginal',
1417         self::SUB_SEC_TIME_DIGITIZED         => 'SubSecTimeDigitized',
1418         self::XP_TITLE                       => 'WindowsXPTitle',
1419         self::XP_COMMENT                     => 'WindowsXPComment',
1420         self::XP_AUTHOR                      => 'WindowsXPAuthor',
1421         self::XP_KEYWORDS                    => 'WindowsXPKeywords',
1422         self::XP_SUBJECT                     => 'WindowsXPSubject',
1423         self::FLASH_PIX_VERSION              => 'FlashPixVersion',
1424         self::COLOR_SPACE                    => 'ColorSpace',
1425         self::PIXEL_X_DIMENSION              => 'PixelXDimension',
1426         self::PIXEL_Y_DIMENSION              => 'PixelYDimension',
1427         self::RELATED_SOUND_FILE             => 'RelatedSoundFile',
1428         self::INTEROPERABILITY_IFD_POINTER   => 'InteroperabilityIFDPointer',
1429         self::FLASH_ENERGY                   => 'FlashEnergy',
1430         self::SPATIAL_FREQUENCY_RESPONSE     => 'SpatialFrequencyResponse',
1431         self::FOCAL_PLANE_X_RESOLUTION       => 'FocalPlaneXResolution',
1432         self::FOCAL_PLANE_Y_RESOLUTION       => 'FocalPlaneYResolution',
1433         self::FOCAL_PLANE_RESOLUTION_UNIT    => 'FocalPlaneResolutionUnit',
1434         self::SUBJECT_LOCATION               => 'SubjectLocation',
1435         self::EXPOSURE_INDEX                 => 'ExposureIndex',
1436         self::SENSING_METHOD                 => 'SensingMethod',
1437         self::FILE_SOURCE                    => 'FileSource',
1438         self::SCENE_TYPE                     => 'SceneType',
1439         self::SUBJECT_AREA                   => 'SubjectArea',
1440         self::CUSTOM_RENDERED                => 'CustomRendered',
1441         self::EXPOSURE_MODE                  => 'ExposureMode',
1442         self::WHITE_BALANCE                  => 'WhiteBalance',
1443         self::DIGITAL_ZOOM_RATIO             => 'DigitalZoomRatio',
1444         self::FOCAL_LENGTH_IN_35MM_FILM      => 'FocalLengthIn35mmFilm',
1445         self::SCENE_CAPTURE_TYPE             => 'SceneCaptureType',
1446         self::GAIN_CONTROL                   => 'GainControl',
1447         self::CONTRAST                       => 'Contrast',
1448         self::SATURATION                     => 'Saturation',
1449         self::SHARPNESS                      => 'Sharpness',
1450         self::DEVICE_SETTING_DESCRIPTION     => 'DeviceSettingDescription',
1451         self::SUBJECT_DISTANCE_RANGE         => 'SubjectDistanceRange',
1452         self::IMAGE_UNIQUE_ID                => 'ImageUniqueID',
1453         self::GAMMA                          => 'Gamma',
1454         self::PRINT_IM                       => 'PrintIM',
1455     );
1456
1457     /**
1458      * Values for tags titles.
1459      */
1460     protected static $exifTagsTitle = array(
1461         self::INTEROPERABILITY_INDEX         => 'Interoperability Index',
1462         self::INTEROPERABILITY_VERSION       => 'Interoperability Version',
1463         self::IMAGE_WIDTH                    => 'Image Width',
1464         self::IMAGE_LENGTH                   => 'Image Length',
1465         self::BITS_PER_SAMPLE                => 'Bits per Sample',
1466         self::COMPRESSION                    => 'Compression',
1467         self::PHOTOMETRIC_INTERPRETATION     => 'Photometric Interpretation',
1468         self::FILL_ORDER                     => 'Fill Order',
1469         self::DOCUMENT_NAME                  => 'Document Name',
1470         self::IMAGE_DESCRIPTION              => 'Image Description',
1471         self::MAKE                           => 'Manufacturer',
1472         self::MODEL                          => 'Model',
1473         self::STRIP_OFFSETS                  => 'Strip Offsets',
1474         self::ORIENTATION                    => 'Orientation',
1475         self::SAMPLES_PER_PIXEL              => 'Samples per Pixel',
1476         self::ROWS_PER_STRIP                 => 'Rows per Strip',
1477         self::STRIP_BYTE_COUNTS              => 'Strip Byte Count',
1478         self::X_RESOLUTION                   => 'x-Resolution',
1479         self::Y_RESOLUTION                   => 'y-Resolution',
1480         self::PLANAR_CONFIGURATION           => 'Planar Configuration',
1481         self::RESOLUTION_UNIT                => 'Resolution Unit',
1482         self::TRANSFER_FUNCTION              => 'Transfer Function',
1483         self::SOFTWARE                       => 'Software',
1484         self::DATE_TIME                      => 'Date and Time',
1485         self::ARTIST                         => 'Artist',
1486         self::WHITE_POINT                    => 'White Point',
1487         self::PRIMARY_CHROMATICITIES         => 'Primary Chromaticities',
1488         self::TRANSFER_RANGE                 => 'Transfer Range',
1489         self::JPEG_PROC                      => 'JPEG Process',
1490         self::JPEG_INTERCHANGE_FORMAT        => 'JPEG Interchange Format',
1491         self::JPEG_INTERCHANGE_FORMAT_LENGTH => 'JPEG Interchange Format Length',
1492         self::YCBCR_COEFFICIENTS             => 'YCbCr Coefficients',
1493         self::YCBCR_SUB_SAMPLING             => 'YCbCr Sub-Sampling',
1494         self::YCBCR_POSITIONING              => 'YCbCr Positioning',
1495         self::REFERENCE_BLACK_WHITE          => 'Reference Black/White',
1496         self::RELATED_IMAGE_FILE_FORMAT      => 'Related Image File Format',
1497         self::RELATED_IMAGE_WIDTH            => 'Related Image Width',
1498         self::RELATED_IMAGE_LENGTH           => 'Related Image Length',
1499         self::CFA_REPEAT_PATTERN_DIM         => 'CFA Repeat Pattern Dim',
1500         self::CFA_PATTERN                    => 'CFA Pattern',
1501         self::BATTERY_LEVEL                  => 'Battery Level',
1502         self::COPYRIGHT                      => 'Copyright',
1503         self::EXPOSURE_TIME                  => 'Exposure Time',
1504         self::FNUMBER                        => 'FNumber',
1505         self::IPTC_NAA                       => 'IPTC/NAA',
1506         self::EXIF_IFD_POINTER               => 'Exif IFD Pointer',
1507         self::INTER_COLOR_PROFILE            => 'Inter Color Profile',
1508         self::EXPOSURE_PROGRAM               => 'Exposure Program',
1509         self::SPECTRAL_SENSITIVITY           => 'Spectral Sensitivity',
1510         self::GPS_INFO_IFD_POINTER           => 'GPS Info IFD Pointer',
1511         self::ISO_SPEED_RATINGS              => 'ISO Speed Ratings',
1512         self::OECF                           => 'OECF',
1513         self::EXIF_VERSION                   => 'Exif Version',
1514         self::DATE_TIME_ORIGINAL             => 'Date and Time (original)',
1515         self::DATE_TIME_DIGITIZED            => 'Date and Time (digitized)',
1516         self::COMPONENTS_CONFIGURATION       => 'Components Configuration',
1517         self::COMPRESSED_BITS_PER_PIXEL      => 'Compressed Bits per Pixel',
1518         self::SHUTTER_SPEED_VALUE            => 'Shutter speed',
1519         self::APERTURE_VALUE                 => 'Aperture',
1520         self::BRIGHTNESS_VALUE               => 'Brightness',
1521         self::EXPOSURE_BIAS_VALUE            => 'Exposure Bias',
1522         self::MAX_APERTURE_VALUE             => 'Max Aperture Value',
1523         self::SUBJECT_DISTANCE               => 'Subject Distance',
1524         self::METERING_MODE                  => 'Metering Mode',
1525         self::LIGHT_SOURCE                   => 'Light Source',
1526         self::FLASH                          => 'Flash',
1527         self::FOCAL_LENGTH                   => 'Focal Length',
1528         self::MAKER_NOTE                     => 'Maker Note',
1529         self::USER_COMMENT                   => 'User Comment',
1530         self::SUB_SEC_TIME                   => 'SubSec Time',
1531         self::SUB_SEC_TIME_ORIGINAL          => 'SubSec Time Original',
1532         self::SUB_SEC_TIME_DIGITIZED         => 'SubSec Time Digitized',
1533         self::XP_TITLE                       => 'Windows XP Title',
1534         self::XP_COMMENT                     => 'Windows XP Comment',
1535         self::XP_AUTHOR                      => 'Windows XP Author',
1536         self::XP_KEYWORDS                    => 'Windows XP Keywords',
1537         self::XP_SUBJECT                     => 'Windows XP Subject',
1538         self::FLASH_PIX_VERSION              => 'FlashPix Version',
1539         self::COLOR_SPACE                    => 'Color Space',
1540         self::PIXEL_X_DIMENSION              => 'Pixel x-Dimension',
1541         self::PIXEL_Y_DIMENSION              => 'Pixel y-Dimension',
1542         self::RELATED_SOUND_FILE             => 'Related Sound File',
1543         self::INTEROPERABILITY_IFD_POINTER   => 'Interoperability IFD Pointer',
1544         self::FLASH_ENERGY                   => 'Flash Energy',
1545         self::SPATIAL_FREQUENCY_RESPONSE     => 'Spatial Frequency Response',
1546         self::FOCAL_PLANE_X_RESOLUTION       => 'Focal Plane x-Resolution',
1547         self::FOCAL_PLANE_Y_RESOLUTION       => 'Focal Plane y-Resolution',
1548         self::FOCAL_PLANE_RESOLUTION_UNIT    => 'Focal Plane Resolution Unit',
1549         self::SUBJECT_LOCATION               => 'Subject Location',
1550         self::EXPOSURE_INDEX                 => 'Exposure index',
1551         self::SENSING_METHOD                 => 'Sensing Method',
1552         self::FILE_SOURCE                    => 'File Source',
1553         self::SCENE_TYPE                     => 'Scene Type',
1554         self::SUBJECT_AREA                   => 'Subject Area',
1555         self::CUSTOM_RENDERED                => 'Custom Rendered',
1556         self::EXPOSURE_MODE                  => 'Exposure Mode',
1557         self::WHITE_BALANCE                  => 'White Balance',
1558         self::DIGITAL_ZOOM_RATIO             => 'Digital Zoom Ratio',
1559         self::FOCAL_LENGTH_IN_35MM_FILM      => 'Focal Length In 35mm Film',
1560         self::SCENE_CAPTURE_TYPE             => 'Scene Capture Type',
1561         self::GAIN_CONTROL                   => 'Gain Control',
1562         self::CONTRAST                       => 'Contrast',
1563         self::SATURATION                     => 'Saturation',
1564         self::SHARPNESS                      => 'Sharpness',
1565         self::DEVICE_SETTING_DESCRIPTION     => 'Device Setting Description',
1566         self::SUBJECT_DISTANCE_RANGE         => 'Subject Distance Range',
1567         self::IMAGE_UNIQUE_ID                => 'Image Unique ID',
1568         self::GAMMA                          => 'Gamma',
1569         self::PRINT_IM                       => 'Print IM',
1570     );
1571
1572     /**
1573      * Values for gps tags short names.
1574      */
1575     protected static $gpsTagsShort = array(
1576         self::GPS_VERSION_ID         => 'GPSVersionID',
1577         self::GPS_LATITUDE_REF       => 'GPSLatitudeRef',
1578         self::GPS_LATITUDE           => 'GPSLatitude',
1579         self::GPS_LONGITUDE_REF      => 'GPSLongitudeRef',
1580         self::GPS_LONGITUDE          => 'GPSLongitude',
1581         self::GPS_ALTITUDE_REF       => 'GPSAltitudeRef',
1582         self::GPS_ALTITUDE           => 'GPSAltitude',
1583         self::GPS_TIME_STAMP         => 'GPSTimeStamp',
1584         self::GPS_SATELLITES         => 'GPSSatellites',
1585         self::GPS_STATUS             => 'GPSStatus',
1586         self::GPS_MEASURE_MODE       => 'GPSMeasureMode',
1587         self::GPS_DOP                => 'GPSDOP',
1588         self::GPS_SPEED_REF          => 'GPSSpeedRef',
1589         self::GPS_SPEED              => 'GPSSpeed',
1590         self::GPS_TRACK_REF          => 'GPSTrackRef',
1591         self::GPS_TRACK              => 'GPSTrack',
1592         self::GPS_IMG_DIRECTION_REF  => 'GPSImgDirectionRef',
1593         self::GPS_IMG_DIRECTION      => 'GPSImgDirection',
1594         self::GPS_MAP_DATUM          => 'GPSMapDatum',
1595         self::GPS_DEST_LATITUDE_REF  => 'GPSDestLatitudeRef',
1596         self::GPS_DEST_LATITUDE      => 'GPSDestLatitude',
1597         self::GPS_DEST_LONGITUDE_REF => 'GPSDestLongitudeRef',
1598         self::GPS_DEST_LONGITUDE     => 'GPSDestLongitude',
1599         self::GPS_DEST_BEARING_REF   => 'GPSDestBearingRef',
1600         self::GPS_DEST_BEARING       => 'GPSDestBearing',
1601         self::GPS_DEST_DISTANCE_REF  => 'GPSDestDistanceRef',
1602         self::GPS_DEST_DISTANCE      => 'GPSDestDistance',
1603         self::GPS_PROCESSING_METHOD  => 'GPSProcessingMethod',
1604         self::GPS_AREA_INFORMATION   => 'GPSAreaInformation',
1605         self::GPS_DATE_STAMP         => 'GPSDateStamp',
1606         self::GPS_DIFFERENTIAL       => 'GPSDifferential',
1607     );
1608
1609     /**
1610      * Returns a string from container with key $tag and subcontainer index of $idx
1611      *
1612      * @param array $container
1613      *            {@link PelTag::EXIF_TAGS_SHORT}, {@link PelTag::EXIF_TAGS_TITLE},
1614      *            {@link PelTag::GPS_TAGS_SHORT} or {@link PelTag::GPS_TAGS_TITLE} container.
1615      * @param PelTag $tag
1616      *            the tag.
1617      *
1618      * @return string short name or long name of the tag.
1619      */
1620     public static function getValue($container, $tag)
1621     {
1622         if (isset($container[ $tag ])) {
1623             return $container[ $tag ];
1624         }
1625
1626         return self::unknownTag($tag);
1627     }
1628
1629     /**
1630      * Reverse lookup of a tag id by its short name. Return false for the unknown tag name.
1631      *
1632      * @param string $name
1633      *            tag short name.
1634      *
1635      * @return mixed (bool|int)
1636      *            the tag.
1637      */
1638     public static function getTagByName($name)
1639     {
1640         $k = array_search($name, self::$exifTagsShort);
1641         if ($k !== false) {
1642             return $k;
1643         }
1644
1645         return array_search($name, static::$gpsTagsShort);
1646     }
1647
1648     /**
1649      * Returns string defining unknown tag.
1650      *
1651      * @param int $tag
1652      *            the tag.
1653      *
1654      * @return string
1655      *            description string.
1656      */
1657     protected static function unknownTag($tag)
1658     {
1659         return Pel::fmt('Unknown: 0x%04X', $tag);
1660     }
1661
1662     /**
1663      * Returns a short name for an Exif tag.
1664      *
1665      * @param int $type
1666      *            the IFD type of the tag, one of {@link PelIfd::IFD0},
1667      *            {@link PelIfd::IFD1}, {@link PelIfd::EXIF}, {@link PelIfd::GPS},
1668      *            or {@link PelIfd::INTEROPERABILITY}.
1669      *
1670      * @param PelTag $tag
1671      *            the tag.
1672      *
1673      * @return string the short name of the tag, e.g., 'ImageWidth' for
1674      *         the {@link IMAGE_WIDTH} tag. If the tag is not known, the string
1675      *         'Unknown:0xTTTT' will be returned where 'TTTT' is the hexadecimal
1676      *         representation of the tag.
1677      */
1678     public static function getName($type, $tag)
1679     {
1680         switch ($type) {
1681             case PelIfd::IFD0:
1682             case PelIfd::IFD1:
1683             case PelIfd::EXIF:
1684             case PelIfd::INTEROPERABILITY:
1685                 return self::getValue(self::$exifTagsShort, $tag);
1686             case PelIfd::GPS:
1687                 return self::getValue(self::$gpsTagsShort, $tag);
1688         }
1689
1690         return self::unknownTag($tag);
1691     }
1692
1693     /**
1694      * Returns a title for an Exif tag.
1695      *
1696      * @param int $type
1697      *            the IFD type of the tag, one of {@link PelIfd::IFD0},
1698      *            {@link PelIfd::IFD1}, {@link PelIfd::EXIF}, {@link PelIfd::GPS},
1699      *            or {@link PelIfd::INTEROPERABILITY}.
1700      *
1701      * @param PelTag $tag
1702      *            the tag.
1703      *
1704      * @return string the title of the tag, e.g., 'Image Width' for the
1705      *         {@link IMAGE_WIDTH} tag. If the tag isn't known, the string
1706      *         'Unknown Tag: 0xTT' will be returned where 'TT' is the
1707      *         hexadecimal representation of the tag.
1708      */
1709     public function getTitle($type, $tag)
1710     {
1711         switch ($type) {
1712             case PelIfd::IFD0:
1713             case PelIfd::IFD1:
1714             case PelIfd::EXIF:
1715             case PelIfd::INTEROPERABILITY:
1716                 return Pel::tra(self::getValue(self::$exifTagsTitle, $tag));
1717             case PelIfd::GPS:
1718                 return Pel::tra(self::getValue(self::$gpsTagsShort, $tag));
1719         }
1720
1721         return self::unknownTag($tag);
1722     }
1723 }