source: extensions/AMetaData/JpegMetaData/Common/Const.class.php @ 7569

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

Update JpegMetadata class to implement COM segment as a tag and keywords in "magic" tags
feature:1975, feature:1976

  • Property svn:executable set to *
File size: 4.6 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 * Constants used by the JpegMetaData classes
36 *
37 * -----------------------------------------------------------------------------
38 *
39 * .. Notes ..
40 *
41 * Float and Double type are not implemented yet
42 *
43 * -----------------------------------------------------------------------------
44 */
45
46  /**
47   * define the value for the LITTLE ENDIAN (Intel) byte order
48   */
49  define("BYTE_ORDER_LITTLE_ENDIAN", "II");
50
51  /**
52   * define the value for the BIG ENDIAN (Motorola) byte order
53   */
54  define("BYTE_ORDER_BIG_ENDIAN", "MM");
55
56
57  /**
58   * in IFDs entries, the data type is given by a byte
59   * theses constants associate a human readable value
60   */
61  class ByteType
62  {
63    /**
64     * unknown type
65     */
66    const UNKNOWN    = 0x00;
67    /**
68     * 8bit
69     * Unsigned integer values from 0 to 255
70     */
71    const UBYTE      = 0x01;
72    /**
73     * ASCII String
74     */
75    const ASCII      = 0x02;
76    /**
77     * 16bit
78     * Unsigned integer values from 0 to 65535
79     */
80    const USHORT     = 0x03;
81    /**
82     * 32bit
83     * Unsigned integer values from 0 to 4294967295
84     */
85    const ULONG      = 0x04;
86    /**
87     * 2x32bit
88     * Unsigned rational number consist of two unsigned 32-bit integers
89     * denoting the enumerator and denominator.
90     * Each integer have values from 0 and 4294967295
91     */
92    const URATIONAL  = 0x05;
93    /**
94     * 8bit
95     * Signed integer values from -128 to 127
96     */
97    const SBYTE      = 0x06;
98    /**
99     * 8bit
100     * Each component will be a byte with no associated interpretation
101     */
102    const UNDEFINED  = 0x07;
103    /**
104     * 16bit
105     * Signed integer values from -32768 to 32767
106     */
107    const SSHORT     = 0x08;
108    /**
109     * 32bit
110     * Signed integer values from -2147483648 to 2147483647
111     */
112    const SLONG      = 0x09;
113    /**
114     * 2x32bit
115     * Signed rational number consist of two signed 32-bit integers
116     * denoting the enumerator and denominator.
117     * Each integer have values from -2147483648 to 2147483647
118     */
119    const SRATIONAL  = 0x0A;
120    const FLOAT      = 0x0B;
121    const DOUBLE     = 0x0C;
122
123    /**
124     * this array gives the byte size of each kind of data
125     */
126    public static $typeSizes =
127    Array(
128      self::UNKNOWN   => 0,
129      self::UBYTE     => 1,
130      self::ASCII     => 1,
131      self::USHORT    => 2,
132      self::ULONG     => 4,
133      self::URATIONAL => 8,
134      self::SBYTE     => 1,
135      self::UNDEFINED => 1,
136      self::SSHORT    => 2,
137      self::SLONG     => 4,
138      self::SRATIONAL => 8,
139      self::FLOAT     => 0,
140      self::DOUBLE    => 0
141    );
142  }
143
144  class Schemas {
145    const EXIF  = "exif";
146    const IPTC  = "iptc";
147    const XMP   = "xmp";
148    const MAGIC = "magic";
149    const COM   = "com";
150
151    const EXIF_TIFF = "exif.tiff";
152    const EXIF_EXIF = "exif.exif";
153    const EXIF_GPS  = "exif.gps";
154    const EXIF_MAKER  = "exif.maker";
155  }
156
157?>
Note: See TracBrowser for help on using the repository browser.