source: extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php @ 5004

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

update GPS, XMP and MAGIC tags

  • Property svn:executable set to *
File size: 9.8 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 MagicTags is the definition of the computed JpegMetadata tags
36 *
37 * -----------------------------------------------------------------------------
38 *
39 * .. Notes ..
40 *
41 * The MagicTags class is derived from the KnownTags class.
42 *
43 * ======> See KnownTags.class.php to know more about the tag definitions <=====
44 *
45 */
46
47  require_once(JPEG_METADATA_DIR."TagDefinitions/KnownTags.class.php");
48
49  /**
50   * Define the "magic" JpegMetadata computed tags
51   *
52   * all tag are defined by a list of metadata
53   *
54   * all metadata are searched in the given list order by their name : if a
55   * given metadata in is not found in the image, the next is searched.
56   *
57   * in most case, according with the Xmp specification, list are defined in
58   * this order :
59   *  - exif tags
60   *  - iptc tags
61   *  - xmp tags
62   *
63   * In some case, the Xmp metadata are in the first place of the list, because
64   * Xmp allows to UTF-8 string and we can consider that if there is exif & xmp
65   * data, the localized UTF-8 is most important
66   *
67   */
68  class MagicTags extends KnownTags
69  {
70    protected $label = "Magic JpegMetadata computed tags";
71    protected $tags = Array(
72
73      'Camera.Make' => Array(
74        'implemented'  => true,
75        'translatable' => false,
76        'tagValues'    => Array(
77          "{exif.tiff.Make}",
78          "{xmp.tiff:Make}",
79        )
80      ),
81
82      'Camera.Model' => Array(
83        'implemented'  => true,
84        'translatable' => false,
85        'tagValues'    => Array(
86          "{exif.tiff.Model}",
87          "{xmp.tiff:Model}",
88        )
89      ),
90
91      'ShotInfo.Aperture' => Array(
92        'implemented'  => true,
93        'translatable' => false,
94        'tagValues'    => Array(
95          "{exif.exif.FNumber}",
96          "{xmp.exif:FNumber}",
97          "{exif.exif.ApertureValue}",
98          "{xmp.exif:ApertureValue}",
99        )
100      ),
101
102      'ShotInfo.Exposure' => Array(
103        'implemented'  => true,
104        'translatable' => false,
105        'tagValues'    => Array(
106          "{exif.exif.ExposureTime}",
107          "{xmp.exif:ExposureTime}",
108          "{exif.exif.ShutterSpeedValue}",
109          "{xmp.exif:ShutterSpeedValue}",
110        )
111      ),
112
113      'ShotInfo.ISO' => Array(
114        'implemented'  => true,
115        'translatable' => false,
116        'tagValues'    => Array(
117          "{exif.exif.ISOSpeedRatings}",
118          "{xmp.exif:ISOSpeedRatings}",
119          "{exif.Pentax.ISO}",
120        )
121      ),
122
123      'ShotInfo.FocalLength' => Array(
124        'implemented'  => true,
125        'translatable' => false,
126        'tagValues'    => Array(
127          "{exif.exif.FocalLength}",
128          "{xmp.exif:FocalLength}",
129          "{exif.Pentax.FocalLength}",
130          "{exif.Canon.CanonCameraInfo.FocalLength}",
131        )
132      ),
133
134      'ShotInfo.FocalLengthIn35mm' => Array(
135        'implemented'  => true,
136        'translatable' => false,
137        'tagValues'    => Array(
138          "{exif.exif.FocalLengthIn35mmFilm}",
139          "{xmp.exif:FocalLengthIn35mmFilm}",
140        )
141      ),
142
143      'ShotInfo.Lens' => Array(
144        'implemented'  => true,
145        'translatable' => false,
146        'tagValues'    => Array(
147          "{exif.Pentax.LensType}",
148          "{exif.Nikon.Lens}",
149          "{exif.Canon.CanonCameraSettings.LensType}",
150          "{exif.Canon.CanonCameraInfo.LensType}",
151          "{xmp.aux:Lens}",
152          "{xmp.aux:LensID}", // work with the Xmp LensId is not the best way to
153                              // know the lens (all data needed to find the
154                              // exact lens are not available in xmp metadata)
155        )
156      ),
157
158      'ShotInfo.DateTime' => Array(
159        'implemented'  => true,
160        'translatable' => false,
161        'tagValues'    => Array(
162          "{exif.exif.DateTimeOriginal}",
163          "{exif.exif.DateTimeDigitized}",
164          "{xmp.exif:DateTimeOriginal}",
165          "{xmp.exif:DateTimeDigitized}",
166        )
167      ),
168
169      'ShotInfo.Flash.Fired' => Array(
170        'implemented'  => true,
171        'translatable' => true,
172        'tagValues'    => Array(
173          "{exif.exif.Flash[detail[0]]}",
174          "{xmp.exif:Fired}",
175        )
176      ),
177
178      'ShotInfo.Flash.RedEyeMode' => Array(
179        'implemented'  => true,
180        'translatable' => true,
181        'tagValues'    => Array(
182          "{exif.exif.Flash[detail[4]]}",
183          "{xmp.exif:RedEyeMode}",
184        )
185      ),
186
187
188      'Image.Width' => Array(
189        'implemented'  => true,
190        'translatable' => false,
191        'tagValues'    => Array(
192          "{exif.exif.PixelXDimension}",
193          "{exif.tiff.ImageWidth}",
194          "{xmp.exif:PixelXDimension}",
195          "{xmp.tiff:ImageWidth}",
196        )
197      ),
198
199      'Image.Height' => Array(
200        'implemented'  => true,
201        'translatable' => false,
202        'tagValues'    => Array(
203          "{exif.exif.PixelYDimension}",
204          "{exif.tiff.ImageHeight}",
205          "{xmp.exif:PixelYDimension}",
206          "{xmp.tiff:ImageHeight}",
207        )
208      ),
209
210      'Image.Dimension' => Array(
211        'implemented'  => true,
212        'translatable' => false,
213        'tagValues' => Array(
214          "{magic.Image.Width}x{magic.Image.Height}"
215        )
216      ),
217
218      'Author.ImageTitle' => Array(
219        'implemented'  => true,
220        'translatable' => false,
221        'tagValues' => Array(
222          "{xmp.dc:title}",
223          "{exif.tiff.ImageDescription}",
224          "{iptc.Object Name}",
225        )
226      ),
227
228      'Author.Artist' => Array(
229        'implemented'  => true,
230        'translatable' => false,
231        'tagValues' => Array(
232          "{xmp.dc:creator[values]}",
233          "{exif.tiff.Artist}",
234          "{iptc.Writer/Editor}",
235        )
236      ),
237
238      'Author.Copyright' => Array(
239        'implemented'  => true,
240        'translatable' => false,
241        'tagValues' => Array(
242          "{xmp.dc:rights}",
243          "{exif.tiff.Copyright}",
244          "{iptc.Copyright Notice}"
245        )
246      ),
247
248      'Author.Comment' => Array(
249        'implemented'  => true,
250        'translatable' => false,
251        'tagValues' => Array(
252          "{xmp.dc:description}",
253          "{iptc.Caption/Abstract}",
254          "{exif.exif.UserComment}",
255        )
256      ),
257
258      'Processing.PostProcessingSoftware' => Array(
259        'implemented'  => true,
260        'translatable' => false,
261        'tagValues' => Array(
262          "{exif.tiff.ProcessingSoftware}",
263          "{exif.tiff.Software}",
264          "{xmp.tiff:Software}",
265          "{xmp.xmp:CreatorTool}",
266          "{iptc.Originating Program} {iptc.Program Version}",
267        )
268      ),
269
270      'Processing.Software' => Array(
271        'implemented'  => true,
272        'translatable' => false,
273        'tagValues' => Array(
274          "{exif.tiff.Software}",
275          "{xmp.tiff:Software}",
276          "{xmp.dc:CreatorTool}",
277          "{exif.Canon.CanonFirmwareVersion}",
278        )
279      ),
280
281      'Processing.OriginalFileName' => Array(
282        'implemented'  => true,
283        'translatable' => false,
284        'tagValues' => Array(
285          "{exif.tiff.DocumentName}",
286          "{xmp.crs:RawFileName}",
287        )
288      ),
289
290      'Processing.PostProcessingDateTime' => Array(
291        'implemented'  => true,
292        'translatable' => false,
293        'tagValues' => Array(
294          "{exif.tiff.DateTime}",
295          "{xmp.xmp:ModifyDate}",
296        )
297      ),
298
299      'GPS.Altitude' => Array(
300        'implemented'  => true,
301        'translatable' => false,
302        'tagValues' => Array(
303          "{exif.gps.GPSAltitudeRef}{exif.gps.GPSAltitude}m",
304          "{xmp.exif:GPSAltitudeRef}{xmp.exif:GPSAltitude}m",
305        )
306      ),
307
308      'GPS.Latitude' => Array(
309        'implemented'  => true,
310        'translatable' => false,
311        'tagValues' => Array(
312          "{exif.gps.GPSLatitude} {exif.gps.GPSLatitudeRef}",
313          "{xmp.exif:GPSLatitude}",
314        )
315      ),
316
317      'GPS.Longitude' => Array(
318        'implemented'  => true,
319        'translatable' => false,
320        'tagValues' => Array(
321          "{exif.gps.GPSLongitude} {exif.gps.GPSLongitudeRef}",
322          "{xmp.exif:GPSLongitude}",
323        )
324      ),
325
326    );
327
328
329    function __destruct()
330    {
331      parent::__destruct();
332    }
333
334  }
335
336
337?>
Note: See TracBrowser for help on using the repository browser.