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 | * Used to stock some var we want to be accessed over all the metadata parsing |
---|
36 | * process |
---|
37 | * |
---|
38 | * Using a class prevent to declare "global" variables |
---|
39 | * Using a class allows to use methods rather than a direct access to the variable |
---|
40 | * calling a static function from an object is more understandable in the code |
---|
41 | * than affect a valu to an unknown global var |
---|
42 | * |
---|
43 | * This class provides theses public functions : |
---|
44 | * - (static) setExifMaker |
---|
45 | * - (static) getExifMaker |
---|
46 | * - (static) setFocal |
---|
47 | * - (static) setAperture |
---|
48 | * |
---|
49 | * ----------------------------------------------------------------------------- |
---|
50 | */ |
---|
51 | |
---|
52 | |
---|
53 | Class GlobalTags |
---|
54 | { |
---|
55 | static private $exifMaker = ""; |
---|
56 | static private $exifFocal = ""; |
---|
57 | static private $exifAperture = ""; |
---|
58 | |
---|
59 | /** |
---|
60 | * this function is used by IFD Reader to store all information about maker |
---|
61 | * and camera model |
---|
62 | * |
---|
63 | * the stored value if used within a grep like "/canon/i" to determine the |
---|
64 | * maker note. |
---|
65 | * For more information about this tricks see the how the tag 0x927c is |
---|
66 | * managed in the function "processSpecialTag" of the file |
---|
67 | * IfdReader.class.php |
---|
68 | * |
---|
69 | * @param String $value : the maker or the camera model |
---|
70 | */ |
---|
71 | static public function setExifMaker($value) |
---|
72 | { |
---|
73 | if(is_array($value)) |
---|
74 | { |
---|
75 | foreach($value as $val) |
---|
76 | { |
---|
77 | self::$exifMaker.=$val." "; |
---|
78 | } |
---|
79 | } |
---|
80 | else |
---|
81 | { |
---|
82 | self::$exifMaker.=$value." "; |
---|
83 | } |
---|
84 | return(self::$exifMaker); |
---|
85 | } |
---|
86 | |
---|
87 | /** |
---|
88 | * this function is used by IFD Reader to store all information about maker |
---|
89 | * and camera model |
---|
90 | * |
---|
91 | * @return String |
---|
92 | */ |
---|
93 | static public function getExifMaker() |
---|
94 | { |
---|
95 | return(self::$exifMaker); |
---|
96 | } |
---|
97 | |
---|
98 | |
---|
99 | /** |
---|
100 | * this function is used by IFD Reader to store information about the focal |
---|
101 | * used to shoot |
---|
102 | * |
---|
103 | * the stored value if used within the pentax reader, to know the lens used |
---|
104 | * with the camera (if lens Id returns more than one lens) |
---|
105 | * |
---|
106 | * For more information about this tricks see the how the tag 0x003f is |
---|
107 | * managed in the function "processSpecialTag" of the file |
---|
108 | * PentaxReader.class.php |
---|
109 | * |
---|
110 | * @param String $value : the focal |
---|
111 | */ |
---|
112 | static public function setExifFocal($value) |
---|
113 | { |
---|
114 | self::$exifFocal=$value; |
---|
115 | return(self::$exifFocal); |
---|
116 | } |
---|
117 | |
---|
118 | /** |
---|
119 | * this function is used by Pentax Reader to know the focal value used to |
---|
120 | * shoot |
---|
121 | * |
---|
122 | * @return String |
---|
123 | */ |
---|
124 | static public function getExifFocal() |
---|
125 | { |
---|
126 | return(self::$exifFocal); |
---|
127 | } |
---|
128 | |
---|
129 | |
---|
130 | /** |
---|
131 | * this function is used by IFD Reader to store information about the |
---|
132 | * aperture used to shoot |
---|
133 | * |
---|
134 | * the stored value if used within the pentax reader, to know the lens used |
---|
135 | * with the camera (if lens Id returns more than one lens) |
---|
136 | * |
---|
137 | * For more information about this tricks see the how the tag 0x003f is |
---|
138 | * managed in the function "processSpecialTag" of the file |
---|
139 | * PentaxReader.class.php |
---|
140 | * |
---|
141 | * @param String $value : the aperture |
---|
142 | */ |
---|
143 | static public function setExifAperture($value) |
---|
144 | { |
---|
145 | self::$exifAperture=$value; |
---|
146 | return(self::$exifAperture); |
---|
147 | } |
---|
148 | |
---|
149 | /** |
---|
150 | * this function is used by Pentax Reader to know the aperture value used to |
---|
151 | * shoot |
---|
152 | * |
---|
153 | * @return String |
---|
154 | */ |
---|
155 | static public function getExifAperture() |
---|
156 | { |
---|
157 | return(self::$exifAperture); |
---|
158 | } |
---|
159 | |
---|
160 | } |
---|
161 | |
---|
162 | ?> |
---|