- Timestamp:
- Jan 17, 2010, 7:05:35 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/JpegMetaData/TagDefinitions/KnownTags.class.php
r4686 r4698 9 9 * << May the Little SpaceFrog be with you ! >> 10 10 * 11 * +-----------------------------------------------------------------------+ 12 * | JpegMetaData - a PHP based Jpeg Metadata manager | 13 * +-----------------------------------------------------------------------+ 14 * | Copyright(C) 2010 Grum - http://www.grum.fr | 15 * +-----------------------------------------------------------------------+ 16 * | This program is free software; you can redistribute it and/or modify | 17 * | it under the terms of the GNU General Public License as published by | 18 * | the Free Software Foundation | 19 * | | 20 * | This program is distributed in the hope that it will be useful, but | 21 * | WITHOUT ANY WARRANTY; without even the implied warranty of | 22 * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 23 * | General Public License for more details. | 24 * | | 25 * | You should have received a copy of the GNU General Public License | 26 * | along with this program; if not, write to the Free Software | 27 * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 28 * | USA. | 29 * +-----------------------------------------------------------------------+ 30 * 31 * 11 32 * ----------------------------------------------------------------------------- 12 33 * 34 * The KnownTags is a generic class to manage the definition of tags 35 * 36 * Tags are defined in an array $tags : 37 * - key => the Tag ID (UShort for exif & Iptc, String for Xmp) 38 * - value => an array with theses properties 39 * 40 * Common properties 41 * 'tagName' => String : the official name of the tag (used for 42 * translation) 43 * 'tagValues' => Array : an array to associate a label for each known 44 * values 45 * 'translatable' => Boolean : set to true if the value can be translated 46 * 'implemented' => Boolean : set to true if the tag needs a specific 47 * interpretation and is implemented 48 * 'schema' => String : schema associated with the tag 49 * exif : "tiff", "exif", "gps", "pentax", ... 50 * xmp : "dc", "exif", "photoshop", ... 51 * => not yet defined for Iptc.... 52 * 'tagValues.special' => used on some tags for implementation 53 * 54 * Exif like tags 55 * 'combiTag' => Integer : use on some specific tags 56 * 57 * Xmp specific properties (==> see XmpTags.class.php for more information) 58 * 'iptcTag' => if the Xmp tag exist in Iptc, the Iptc tag Id 59 * 'exifTag' => if the Xmp tag exist in Exif, the Exif tag Id 60 * 'type' => the type of Xmp data 61 * 13 62 * ----------------------------------------------------------------------------- 14 63 * 64 * .. Notes .. 65 * 66 * This class is not declared as an abstract class, but it's not recommanded to 67 * create object with it. 68 * 69 * Derived classes : 70 * - GpsTags (exif gps tags) 71 * - IfdTag (exif & tiff tags) 72 * - IptcTag (iptc tags) 73 * - PentaxTag (pentax exif tags) 74 * - XmpTag (xmp tags) 75 * 76 * 77 * This class provides theses public functions : 78 * - getTags 79 * - tagIdExists 80 * - getTagById 81 * - getTagIdByName 82 * - getTagByName 83 * - getLabel 84 * 15 85 * ----------------------------------------------------------------------------- 86 * 16 87 */ 17 88 … … 35 106 } 36 107 108 /** 109 * this function return the $tags array 110 * 111 * an optional parameter $filter can be given. 112 * its an array with the keys : 113 * 'implemented' => Integer = KNOWN_TAGS_ALL, KNOWN_TAGS_IMPLEMENTED, KNOWN_TAGS_NOT_IMPLEMENTED 114 * filter tags with the property 'implemented' and 'known' 115 * 'schema' => String = name of the schema 116 * filter tags with the schema property 117 * 118 * @param Array $filter (optional) 119 * @return Array : an array of tags properties (see this file header to know 120 * more about the tag properties) 121 */ 37 122 public function getTags($filter = Array('implemented' => KNOWN_TAGS_ALL, 'schema' => NULL)) 38 123 { … … 64 149 } 65 150 151 /** 152 * this function returns true if the given ID exists 153 * 154 * @return Boolean 155 */ 66 156 public function tagIdExists($id) 67 157 { … … 69 159 } 70 160 71 161 /** 162 * returns a tag, searched by its ID 163 * return false if the tag is not found 164 * 165 * @return Array : see this file header to know more about the tag properties 166 */ 72 167 public function getTagById($id) 73 168 { … … 79 174 } 80 175 176 /** 177 * returns the tag ID, searched by its name property 178 * return false if the tag is not found 179 * 180 * @return String or UShort 181 */ 81 182 public function getTagIdByName($name) 82 183 { … … 89 190 } 90 191 192 /** 193 * returns a Tag, searched by its name property 194 * return false if the tag is not found 195 * 196 * @return Array : see this file header to know more about the tag properties 197 */ 91 198 public function getTagByName($name) 92 199 { 93 200 $index=$this->getTagIdByName($name); 94 if( index!==false)201 if($index!==false) 95 202 return($this->tags[$index]); 96 203 return(false); 97 204 } 98 205 206 /** 207 * return the label associated with the tag defininition 208 * (something like "Exif & Tiff tags" or "Pentax specific tags") 209 * 210 * @return String 211 */ 99 212 public function getLabel() 100 213 {
Note: See TracChangeset
for help on using the changeset viewer.