Changeset 224 for exifer

Show
Ignore:
Timestamp:
08/16/07 12:55:46 (17 months ago)
Author:
082net
Message:

## exifer ##

exifer version 1.6 update (zenphoto)

Location:
exifer/trunk/lib
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • exifer/trunk/lib/exif.php

    r21 r224  
    1 <? 
    2 //================================================================================================ 
    3 //================================================================================================ 
    4 //================================================================================================ 
     1<?php 
    52/* 
    6         Exifer 1.5 
    7         Extracts EXIF information from digital photos. 
    8          
    9         Copyright � 2005 Jake Olefsky 
    10         http://www.offsky.com/software/exif/index.php 
    11         jake@olefsky.com 
    12          
    13         This program is free software; you can redistribute it and/or modify it under the terms of  
    14         the GNU General Public License as published by the Free Software Foundation; either version 2  
    15         of the License, or (at your option) any later version. 
    16  
    17         This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;  
    18         without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   
    19         See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html 
    20          
    21         SUMMARY: 
    22                                 This script will correctly parse all of the EXIF data included in images taken 
    23                                 with digital cameras.  It will read the IDF0, IDF1, SubIDF and InteroperabilityIFD 
    24                                 fields as well as parsing some of the MakerNote fields that vary depending on 
    25                                 camera make and model.  This script parses more tags than the internal PHP exif 
    26                                 implementation and it will correctly identify and decode what all the values mean. 
    27                                  
    28                                 This version will correctly parse the MakerNote field for Nikon, Olympus, and Canon  
    29                                 digital cameras.  Others will follow. 
    30                                  
    31         TESTED WITH: 
    32                                 Nikon CoolPix 700 
    33                                 Nikon CoolPix 4500 
    34                                 Nikon CoolPix 950 
    35                                 Nikon Coolpix 5700 
    36                                 Canon PowerShot S200 
    37                                 Canon PowerShot S110 
    38                                 Olympus C2040Z  
    39                                 Olympus C960 
    40                                 Canon Ixus 
    41                                 Canon EOS 300D 
    42                                 Canon Digital Rebel 
    43                                 Canon EOS 10D 
    44                                 Canon PowerShot G2 
    45                                 FujiFilm DX 10 
    46                                 FujiFilm MX-1200 
    47                                 FujiFilm FinePix2400 
    48                                 FujiFilm FinePix2600 
    49                                 FujiFilm FinePix S602 
    50                                 FujiFilm FinePix40i 
    51                                 Sony D700 
    52                                 Sony Cybershot 
    53                                 Kodak DC210 
    54                                 Kodak DC240 
    55                                 Kodak DC4800 
    56                                 Kodak DX3215 
    57                                 Ricoh RDC-5300  
    58                                 Sanyo VPC-G250 
    59                                 Sanyo VPC-SX550 
    60                                 Epson 3100z 
    61                                  
    62         If you improve this script or test it with a camera not on my list, please email me a copy of 
    63         the improvement so everyone can benefit from it.  Thanks!  
    64          
    65          
    66         VERSION HISTORY: 
    67          
    68         1.0     Sept 23, 2002    
    69          
    70                         First Public Release 
    71          
    72         1.1             Jan 25, 2003 
    73                  
    74                         +Gracefully handled the error case where you pass an empty string to this library 
    75                         +Fixed an inconsistency in the Olympus Camera parsing module 
    76                         +Added support for parsing the MakerNote of Canon images. 
    77                         +Modified how the imagefile is opened so it works for windows machines. 
    78                         +Correctly parses the FocalPlaneResolutionUnit and PhotometricInterpretation fields 
    79                         +Negative rational numbers are properly displayed 
    80                         +Strange old cameras that use Motorola endineness are now properly supported 
    81                         +Tested with several more cameras 
    82                          
    83                         Potential Problem: Negative Shorts and Negative Longs may not be correctly displayed, but I 
    84                                 have not yet found an example of negative shorts or longs being used. 
    85          
    86         1.2             Mar 30, 2003 
    87          
    88                         +Fixed an error that was displayed if you edited your image with WinXP's image viewer 
    89                         +Fixed a bug that caused some images saved from 3rd party software to not parse correctly 
    90                         +Changed the ExposureTime tag to display in fractional seconds rather than decimal 
    91                         +Updated the ShutterSpeedValue tag to have the units of 'sec' 
    92                         +Added support for parsing the MakeNote of FujiFilm images 
    93                         +Added support for parsing the MakeNote of Sanyo images 
    94                         +Fixed a bug with parsing some Olympus MakerNote tags 
    95                         +Tested with several more cameras 
    96                          
    97         1.3             Jun 15, 2003 
    98          
    99                         +Fixed Canon MakerNote support for some models 
    100                                 (Canon has very difficult and inconsistent MakerNote syntax) 
    101                         +Negative signed shorts and negative signed longs are properly displayed 
    102                         +Several more tags are defined 
    103                         +More information in my comments about what each tag is 
    104                         +Parses and Displays GPS information if available 
    105                         +Tested with several more cameras 
    106                          
    107         1.4             Sept 14, 2003 
    108                  
    109                         +This software is now licensed under the GNU General Public License 
    110                         +Exposure time is now correctly displayed when the numerator is 10 
    111                         +Fixed the calculation and display of ShutterSpeedValue, ApertureValue and MaxApertureValue  
    112                         +Fixed a bug with the GPS code 
    113                         +Tested with several more cameras 
    114                          
    115         1.5             Feb 18, 2005 
    116          
    117                         +It now gracefully deals with a passed in file that cannot be found. 
    118                         +Fixed a GPS bug for the parsing of Altitude and other signed rational numbers 
    119                         +Defined more values for Canon cameras. 
    120                         +Added "bulb" detection for ShutterSpeed 
    121                         +Made script loading a little faster and less memory intensive. 
    122                         +Bug fixes 
    123                         +Better error reporting 
    124                         +Graceful failure for files with corrupt exif info. 
    125                         +QuickTime (including iPhoto) messes up the Makernote tag for certain photos (no workaround yet) 
    126                         +Now reads exif information when the jpeg markers are out of order 
    127                         +Gives raw data output for IPTC, COM and APP2 fields which are sometimes set by other applications 
    128                         +Improvements to Nikon Makernote parsing 
     3  Exifer 1.6 
     4  Extracts EXIF information from digital photos. 
     5   
     6  Originally created by: 
     7  Copyright � 2005 Jake Olefsky 
     8  http:// www.offsky.com/software/exif/index.php 
     9  jake@olefsky.com 
     10   
     11  This program is free software; you can redistribute it and/or modify it under the terms of  
     12  the GNU General Public License as published by the Free Software Foundation; either version 2  
     13  of the License, or (at your option) any later version. 
     14 
     15  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;  
     16  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   
     17  See the GNU General Public License for more details. http:// www.gnu.org/copyleft/gpl.html 
     18   
     19  SUMMARY: 
     20        This script will correctly parse all of the EXIF data included in images taken 
     21        with digital cameras.  It will read the IDF0, IDF1, SubIDF and InteroperabilityIFD 
     22        fields as well as parsing some of the MakerNote fields that vary depending on 
     23        camera make and model.  This script parses more tags than the internal PHP exif 
     24        implementation and it will correctly identify and decode what all the values mean. 
     25         
     26        This version will correctly parse the MakerNote field for Nikon, Olympus, and Canon  
     27        digital cameras.  Others will follow. 
     28         
     29  TESTED WITH: 
     30        Nikon CoolPix 700 
     31        Nikon CoolPix E3200 
     32        Nikon CoolPix 4500 
     33        Nikon CoolPix 950 
     34        Nikon Coolpix 5700 
     35        Canon PowerShot S200 
     36        Canon PowerShot S110 
     37        Olympus C2040Z  
     38        Olympus C960 
     39        Olumpus E-300 
     40        Olympus E-500 
     41        Canon Ixus 
     42        Canon EOS 300D 
     43        Canon Digital Rebel 
     44        Canon EOS 10D 
     45        Canon PowerShot G2 
     46        FujiFilm DX 10 
     47        FujiFilm MX-1200 
     48        FujiFilm FinePix2400 
     49        FujiFilm FinePix2600 
     50        FujiFilm FinePix S602 
     51        FujiFilm FinePix40i 
     52        Sony D700 
     53        Sony Cybershot 
     54        Kodak DC210 
     55        Kodak DC240 
     56        Kodak DC4800 
     57        Kodak DX3215 
     58        Ricoh RDC-5300  
     59        Sanyo VPC-G250 
     60        Sanyo VPC-SX550 
     61        Epson 3100z 
     62 
     63   
     64  VERSION HISTORY: 
     65   
     66  1.0   September 23, 2002    
     67   
     68    + First Public Release 
     69   
     70  1.1    January 25, 2003 
     71     
     72    + Gracefully handled the error case where you pass an empty string to this library 
     73    + Fixed an inconsistency in the Olympus Camera parsing module 
     74    + Added support for parsing the MakerNote of Canon images. 
     75    + Modified how the imagefile is opened so it works for windows machines. 
     76    + Correctly parses the FocalPlaneResolutionUnit and PhotometricInterpretation fields 
     77    + Negative rational numbers are properly displayed 
     78    + Strange old cameras that use Motorola endineness are now properly supported 
     79    + Tested with several more cameras 
     80     
     81    Potential Problem: Negative Shorts and Negative Longs may not be correctly displayed, but I 
     82      have not yet found an example of negative shorts or longs being used. 
     83   
     84  1.2    March 30, 2003 
     85   
     86    + Fixed an error that was displayed if you edited your image with WinXP's image viewer 
     87    + Fixed a bug that caused some images saved from 3rd party software to not parse correctly 
     88    + Changed the ExposureTime tag to display in fractional seconds rather than decimal 
     89    + Updated the ShutterSpeedValue tag to have the units of 'sec' 
     90    + Added support for parsing the MakeNote of FujiFilm images 
     91    + Added support for parsing the MakeNote of Sanyo images 
     92    + Fixed a bug with parsing some Olympus MakerNote tags 
     93    + Tested with several more cameras 
     94       
     95  1.3    June 15, 2003 
     96   
     97    + Fixed Canon MakerNote support for some models 
     98       (Canon has very difficult and inconsistent MakerNote syntax) 
     99    + Negative signed shorts and negative signed longs are properly displayed 
     100    + Several more tags are defined 
     101    + More information in my comments about what each tag is 
     102    + Parses and Displays GPS information if available 
     103    + Tested with several more cameras 
     104       
     105  1.4    September 14, 2003 
     106     
     107    + This software is now licensed under the GNU General Public License 
     108    + Exposure time is now correctly displayed when the numerator is 10 
     109    + Fixed the calculation and display of ShutterSpeedValue, ApertureValue and MaxApertureValue  
     110    + Fixed a bug with the GPS code 
     111    + Tested with several more cameras 
     112       
     113  1.5    February 18, 2005 
     114   
     115    + It now gracefully deals with a passed in file that cannot be found. 
     116    + Fixed a GPS bug for the parsing of Altitude and other signed rational numbers 
     117    + Defined more values for Canon cameras. 
     118    + Added 'bulb' detection for ShutterSpeed 
     119    + Made script loading a little faster and less memory intensive. 
     120    + Bug fixes 
     121    + Better error reporting 
     122    + Graceful failure for files with corrupt exif info. 
     123    + QuickTime (including iPhoto) messes up the Makernote tag for certain photos (no workaround yet) 
     124    + Now reads exif information when the jpeg markers are out of order 
     125    + Gives raw data output for IPTC, COM and APP2 fields which are sometimes set by other applications 
     126    + Improvements to Nikon Makernote parsing 
     127       
     128  1.6  March 25th, 2007 
     129   
     130    + Adopted into the Zenphoto gallery project, see http:// www.zenphoto.org 
     131    + Fixed a bug where strings had trailing null bytes. 
     132    + Formatted certain strings better. 
     133    + Added calculation of 35mm-equivalent focal length when possible. 
     134    + Cleaned up code for readability and efficiency. 
     135     
    129136*/ 
    130 //================================================================================================ 
    131 //================================================================================================ 
    132 //================================================================================================ 
    133  
    134  
    135          
    136  
    137 //================================================================================================ 
     137 
     138 
     139 
     140   
     141 
     142 
    138143//================================================================================================ 
    139144// Converts from Intel to Motorola endien.  Just reverses the bytes (assumes hex is passed in) 
    140145//================================================================================================ 
    141 //================================================================================================ 
     146 
    142147function intel2Moto($intel) { 
    143         $len = strlen($intel); 
    144         $moto=""; 
    145         for($i=0; $i<=$len; $i+=2) { 
    146                 $moto.=substr($intel,$len-$i,2); 
    147         } 
    148         return $moto; 
     148  $len = strlen($intel); 
     149  $moto = ''; 
     150  for($i = 0; $i <= $len; $i += 2) { 
     151    $moto .= substr($intel, $len-$i, 2); 
     152  } 
     153  return $moto; 
    149154} 
    150155 
    151 //================================================================================================ 
     156 
    152157//================================================================================================ 
    153158// Looks up the name of the tag 
    154159//================================================================================================ 
    155 //================================================================================================ 
    156160function lookup_tag($tag) { 
    157         switch($tag) { 
    158          
    159                         //used by IFD0 "Camera Tags" 
    160                 case "000b": $tag = "ACDComment";break;                                         //text string up to 999 bytes long 
    161                 case "00fe": $tag = "ImageType";break;                                          //integer -2147483648 to 2147483647 
    162                 case "0106": $tag = "PhotometricInterpret";break;                       //?? Please send sample image with this tag 
    163                 case "010e": $tag = "ImageDescription";break;                           //text string up to 999 bytes long 
    164                 case "010f": $tag = "Make";break;                                                       //text string up to 999 bytes long 
    165                 case "0110": $tag = "Model";break;                                                      //text string up to 999 bytes long 
    166                 case "0112": $tag = "Orientation";break;                                        //integer values 1-9 
    167                 case "0115": $tag = "SamplePerPixel";break;                                     //integer 0-65535 
    168                 case "011a": $tag = "xResolution";break;                                        //positive rational number 
    169                 case "011b": $tag = "yResolution";break;                                        //positive rational number 
    170                 case "011c": $tag = "PlanarConfig";break;                                       //integer values 1-2 
    171                 case "0128": $tag = "ResolutionUnit";break;                                     //integer values 1-3 
    172                 case "0131": $tag = "Software";break;                                           //text string up to 999 bytes long 
    173                 case "0132": $tag = "DateTime";break;                                           //YYYY:MM:DD HH:MM:SS 
    174                 case "013b": $tag = "Artist";break;                                                     //text string up to 999 bytes long 
    175                 case "013c": $tag = "HostComputer";break;                                       //text string 
    176                 case "013e": $tag = "WhitePoint";break;                                         //two positive rational numbers 
    177                 case "013f": $tag = "PrimaryChromaticities";break;                      //six positive rational numbers 
    178                 case "0211": $tag = "YCbCrCoefficients";break;                          //three positive rational numbers 
    179                 case "0213": $tag = "YCbCrPositioning";break;                           //integer values 1-2 
    180                 case "0214": $tag = "ReferenceBlackWhite";break;                        //six positive rational numbers 
    181                 case "8298": $tag = "Copyright";break;                                          //text string up to 999 bytes long 
    182                 case "8649": $tag = "PhotoshopSettings";break;                          //??     
    183                 case "8825": $tag = "GPSInfoOffset";break; 
    184                 case "9286": $tag = "UserCommentOld";break;                                     //?? 
    185                 case "8769": $tag = "ExifOffset";break;                                         //positive integer 
    186                  
    187                         //used by Exif SubIFD "Image Tags" 
    188                 case "829a": $tag = "ExposureTime";break;                                       //seconds or fraction of seconds 1/x 
    189                 case "829d": $tag = "FNumber";break;                                            //positive rational number 
    190                 case "8822": $tag = "ExposureProgram";break;                            //integer value 1-9 
    191                 case "8824": $tag = "SpectralSensitivity";break;                        //?? 
    192                 case "8827": $tag = "ISOSpeedRatings";break;                            //integer 0-65535 
    193                 case "9000": $tag = "ExifVersion";break;                                        //?? 
    194                 case "9003": $tag = "DateTimeOriginal";break;                           //YYYY:MM:DD HH:MM:SS 
    195                 case "9004": $tag = "DateTimedigitized";break;                          //YYYY:MM:DD HH:MM:SS 
    196                 case "9101": $tag = "ComponentsConfiguration";break;            //?? 
    197                 case "9102": $tag = "CompressedBitsPerPixel";break;                     //positive rational number 
    198                 case "9201": $tag = "ShutterSpeedValue";break;                          //seconds or fraction of seconds 1/x 
    199                 case "9202": $tag = "ApertureValue";break;                                      //positive rational number 
    200                 case "9203": $tag = "BrightnessValue";break;                            //positive rational number 
    201                 case "9204": $tag = "ExposureBiasValue";break;                          //positive rational number (EV) 
    202                 case "9205": $tag = "MaxApertureValue";break;                           //positive rational number 
    203                 case "9206": $tag = "SubjectDistance";break;                            //positive rational number (meters) 
    204                 case "9207": $tag = "MeteringMode";break;                                       //integer 1-6 and 255 
    205                 case "9208": $tag = "LightSource";break;                                        //integer 1-255 
    206                 case "9209": $tag = "Flash";break;                                                      //integer 1-255 
    207                 case "920a": $tag = "FocalLength";break;                                        //positive rational number (mm) 
    208                 case "9213": $tag = "ImageHistory";break;                                       //text string up to 999 bytes long 
    209                 case "927c": $tag = "MakerNote";break;                                          //a bunch of data 
    210                 case "9286": $tag = "UserComment";break;                                        //text string 
    211                 case "9290": $tag = "SubsecTime";break;                                         //text string up to 999 bytes long 
    212                 case "9291": $tag = "SubsecTimeOriginal";break;                         //text string up to 999 bytes long 
    213                 case "9292": $tag = "SubsecTimeDigitized";break;                        //text string up to 999 bytes long 
    214                 case "a000": $tag = "FlashPixVersion";break;                            //?? 
    215                 case "a001": $tag = "ColorSpace";break;                                         //values 1 or 65535 
    216                 case "a002": $tag = "ExifImageWidth";break;                                     //ingeter 1-65535 
    217                 case "a003": $tag = "ExifImageHeight";break;                            //ingeter 1-65535 
    218                 case "a004": $tag = "RelatedSoundFile";break;                           //text string 12 bytes long 
    219                 case "a005": $tag = "ExifInteroperabilityOffset";break;         //positive integer 
    220                 case "a20c": $tag = "SpacialFreqResponse";break;                        //?? 
    221                 case "a20b": $tag = "FlashEnergy";break;                                        //positive rational number 
    222                 case "a20e": $tag = "FocalPlaneXResolution";break;                      //positive rational number 
    223                 case "a20f": $tag = "FocalPlaneYResolution";break;                      //positive rational number 
    224                 case "a210": $tag = "FocalPlaneResolutionUnit";break;           //values 1-3 
    225                 case "a214": $tag = "SubjectLocation";break;                            //two integers 0-65535 
    226                 case "a215": $tag = "ExposureIndex";break;                                      //positive rational number 
    227                 case "a217": $tag = "SensingMethod";break;                                      //values 1-8 
    228                 case "a300": $tag = "FileSource";break;                                         //integer 
    229                 case "a301": $tag = "SceneType";break;                                          //integer 
    230                 case "a302": $tag = "CFAPattern";break;                                         //undefined data type 
    231                  
    232                 case "a401": $tag = "CustomerRender";break;                                     //values 0 or 1 
    233                 case "a402": $tag = "ExposureMode";break;                                       //values 0-2 
    234                 case "a403": $tag = "WhiteBalance";break;                                       //values 0 or 1 
    235                 case "a404": $tag = "DigitalZoomRatio";break;                           //positive rational number 
    236                 case "a406": $tag = "SceneCaptureMode";break;                           //values 0-3 
    237                 case "a407": $tag = "GainControl";break;                                        //values 0-4 
    238                 case "a408": $tag = "Contrast";break;                                           //values 0-2 
    239                 case "a409": $tag = "Saturation";break;                                         //values 0-2 
    240                 case "a40a": $tag = "Sharpness";break;                                          //values 0-2 
    241  
    242  
    243                         //used by Interoperability IFD 
    244                 case "0001": $tag = "InteroperabilityIndex";break;                      //text string 3 bytes long 
    245                 case "0002": $tag = "InteroperabilityVersion";break;            //datatype undefined 
    246                 case "1000": $tag = "RelatedImageFileFormat";break;                     //text string up to 999 bytes long 
    247                 case "1001": $tag = "RelatedImageWidth";break;                          //integer in range 0-65535 
    248                 case "1002": $tag = "RelatedImageLength";break;                         //integer in range 0-65535 
    249                  
    250                         //used by IFD1 "Thumbnail" 
    251                 case "0100": $tag = "ImageWidth";break;                                         //integer in range 0-65535 
    252                 case "0101": $tag = "ImageLength";break;                                        //integer in range 0-65535 
    253                 case "0102": $tag = "BitsPerSample";break;                                      //integers in range 0-65535 
    254                 case "0103": $tag = "Compression";break;                                        //values 1 or 6 
    255                 case "0106": $tag = "PhotometricInterpretation";break;          //values 0-4 
    256                 case "010e": $tag = "ThumbnailDescription";break;                       //text string up to 999 bytes long 
    257                 case "010f": $tag = "ThumbnailMake";break;                                      //text string up to 999 bytes long 
    258                 case "0110": $tag = "ThumbnailModel";break;                                     //text string up to 999 bytes long 
    259                 case "0111": $tag = "StripOffsets";break;                                       //?? 
    260                 case "0112": $tag = "ThumbnailOrientation";break;                       //integer 1-9 
    261                 case "0115": $tag = "SamplesPerPixel";break;                            //?? 
    262                 case "0116": $tag = "RowsPerStrip";break;                                       //?? 
    263                 case "0117": $tag = "StripByteCounts";break;                            //?? 
    264                 case "011a": $tag = "ThumbnailXResolution";break;                       //positive rational number 
    265                 case "011b": $tag = "ThumbnailYResolution";break;                       //positive rational number 
    266                 case "011c": $tag = "PlanarConfiguration";break;                        //values 1 or 2 
    267                 case "0128": $tag = "ThumbnailResolutionUnit";break;            //values 1-3             
    268                 case "0201": $tag = "JpegIFOffset";break;                                
    269                 case "0202": $tag = "JpegIFByteCount";break; 
    270                 case "0212": $tag = "YCbCrSubSampling";break; 
    271          
    272                         //misc 
    273                 case "00ff": $tag = "SubfileType";break; 
    274                 case "012d": $tag = "TransferFunction";break; 
    275                 case "013d": $tag = "Predictor";break; 
    276                 case "0142": $tag = "TileWidth";break; 
    277                 case "0143": $tag = "TileLength";break; 
    278                 case "0144": $tag = "TileOffsets";break; 
    279                 case "0145": $tag = "TileByteCounts";break; 
    280                 case "014a": $tag = "SubIFDs";break; 
    281                 case "015b": $tag = "JPEGTables";break; 
    282                 case "828d": $tag = "CFARepeatPatternDim";break; 
    283                 case "828e": $tag = "CFAPattern";break; 
    284                 case "828f": $tag = "BatteryLevel";break; 
    285                 case "83bb": $tag = "IPTC/NAA";break; 
    286                 case "8773": $tag = "InterColorProfile";break; 
    287                  
    288                 case "8828": $tag = "OECF";break; 
    289                 case "8829": $tag = "Interlace";break; 
    290                 case "882a": $tag = "TimeZoneOffset";break; 
    291                 case "882b": $tag = "SelfTimerMode";break; 
    292                 case "920b": $tag = "FlashEnergy";break; 
    293                 case "920c": $tag = "SpatialFrequencyResponse";break; 
    294                 case "920d": $tag = "Noise";break; 
    295                 case "9211": $tag = "ImageNumber";break; 
    296                 case "9212": $tag = "SecurityClassification";break; 
    297                 case "9214": $tag = "SubjectLocation";break; 
    298                 case "9215": $tag = "ExposureIndex";break; 
    299                 case "9216": $tag = "TIFF/EPStandardID";break; 
    300                 case "a20b": $tag = "FlashEnergy";break; 
    301                  
    302                 default: $tag = "unknown:".$tag;break; 
    303         } 
    304         return $tag; 
     161  switch($tag) { 
     162    // used by IFD0 'Camera Tags' 
     163    case '000b': $tag = 'ACDComment'; break;               // text string up to 999 bytes long 
     164    case '00fe': $tag = 'ImageType'; break;                // integer -2147483648 to 2147483647 
     165    case '0106': $tag = 'PhotometricInterpret'; break;     // ?? Please send sample image with this tag 
     166    case '010e': $tag = 'ImageDescription'; break;         // text string up to 999 bytes long 
     167    case '010f': $tag = 'Make'; break;                     // text string up to 999 bytes long 
     168    case '0110': $tag = 'Model'; break;                    // text string up to 999 bytes long 
     169    case '0112': $tag = 'Orientation'; break;              // integer values 1-9 
     170    case '0115': $tag = 'SamplePerPixel'; break;           // integer 0-65535 
     171    case '011a': $tag = 'xResolution'; break;              // positive rational number 
     172    case '011b': $tag = 'yResolution'; break;              // positive rational number 
     173    case '011c': $tag = 'PlanarConfig'; break;             // integer values 1-2 
     174    case '0128': $tag = 'ResolutionUnit'; break;           // integer values 1-3 
     175    case '0131': $tag = 'Software'; break;                 // text string up to 999 bytes long 
     176    case '0132': $tag = 'DateTime'; break;                 // YYYY:MM:DD HH:MM:SS 
     177    case '013b': $tag = 'Artist'; break;                   // text string up to 999 bytes long 
     178    case '013c': $tag = 'HostComputer'; break;             // text string 
     179    case '013e': $tag = 'WhitePoint'; break;               // two positive rational numbers 
     180    case '013f': $tag = 'PrimaryChromaticities'; break;    // six positive rational numbers 
     181    case '0211': $tag = 'YCbCrCoefficients'; break;        // three positive rational numbers 
     182    case '0213': $tag = 'YCbCrPositioning'; break;         // integer values 1-2 
     183    case '0214': $tag = 'ReferenceBlackWhite'; break;      // six positive rational numbers 
     184    case '8298': $tag = 'Copyright'; break;                // text string up to 999 bytes long 
     185    case '8649': $tag = 'PhotoshopSettings'; break;        // ??   
     186    case '8825': $tag = 'GPSInfoOffset'; break;             
     187    case '9286': $tag = 'UserCommentOld'; break;           // ?? 
     188    case '8769': $tag = 'ExifOffset'; break;               // positive integer 
     189                                                            
     190    // used by Exif SubIFD 'Image Tags'                     
     191    case '829a': $tag = 'ExposureTime'; break;             // seconds or fraction of seconds 1/x 
     192    case '829d': $tag = 'FNumber'; break;                  // positive rational number 
     193    case '8822': $tag = 'ExposureProgram'; break;          // integer value 1-9 
     194    case '8824': $tag = 'SpectralSensitivity'; break;      // ?? 
     195    case '8827': $tag = 'ISOSpeedRatings'; break;          // integer 0-65535 
     196    case '9000': $tag = 'ExifVersion'; break;              // ?? 
     197    case '9003': $tag = 'DateTimeOriginal'; break;         // YYYY:MM:DD HH:MM:SS 
     198    case '9004': $tag = 'DateTimedigitized'; break;        // YYYY:MM:DD HH:MM:SS 
     199    case '9101': $tag = 'ComponentsConfiguration'; break;  // ?? 
     200    case '9102': $tag = 'CompressedBitsPerPixel'; break;   // positive rational number 
     201    case '9201': $tag = 'ShutterSpeedValue'; break;        // seconds or fraction of seconds 1/x 
     202    case '9202': $tag = 'ApertureValue'; break;            // positive rational number 
     203    case '9203': $tag = 'BrightnessValue'; break;          // positive rational number 
     204    case '9204': $tag = 'ExposureBiasValue'; break;        // positive rational number (EV) 
     205    case '9205': $tag = 'MaxApertureValue'; break;         // positive rational number 
     206    case '9206': $tag = 'SubjectDistance'; break;          // positive rational number (meters) 
     207    case '9207': $tag = 'MeteringMode'; break;             // integer 1-6 and 255 
     208    case '9208': $tag = 'LightSource'; break;              // integer 1-255 
     209    case '9209': $tag = 'Flash'; break;                    // integer 1-255 
     210    case '920a': $tag = 'FocalLength'; break;              // positive rational number (mm) 
     211    case '9213': $tag = 'ImageHistory'; break;             // text string up to 999 bytes long 
     212    case '927c': $tag = 'MakerNote'; break;                // a bunch of data 
     213    case '9286': $tag = 'UserComment'; break;              // text string 
     214    case '9290': $tag = 'SubsecTime'; break;               // text string up to 999 bytes long 
     215    case '9291': $tag = 'SubsecTimeOriginal'; break;       // text string up to 999 bytes long 
     216    case '9292': $tag = 'SubsecTimeDigitized'; break;      // text string up to 999 bytes long 
     217    case 'a000': $tag = 'FlashPixVersion'; break;          // ?? 
     218    case 'a001': $tag = 'ColorSpace'; break;               // values 1 or 65535 
     219    case 'a002': $tag = 'ExifImageWidth'; break;           // ingeter 1-65535 
     220    case 'a003': $tag = 'ExifImageHeight'; break;          // ingeter 1-65535 
     221    case 'a004': $tag = 'RelatedSoundFile'; break;         // text string 12 bytes long 
     222    case 'a005': $tag = 'ExifInteroperabilityOffset'; break;    // positive integer 
     223    case 'a20c': $tag = 'SpacialFreqResponse'; break;      // ?? 
     224    case 'a20b': $tag = 'FlashEnergy'; break;              // positive rational number 
     225    case 'a20e': $tag = 'FocalPlaneXResolution'; break;    // positive rational number 
     226    case 'a20f': $tag = 'FocalPlaneYResolution'; break;    // positive rational number 
     227    case 'a210': $tag = 'FocalPlaneResolutionUnit'; break; // values 1-3 
     228    case 'a214': $tag = 'SubjectLocation'; break;          // two integers 0-65535 
     229    case 'a215': $tag = 'ExposureIndex'; break;            // positive rational number 
     230    case 'a217': $tag = 'SensingMethod'; break;            // values 1-8 
     231    case 'a300': $tag = 'FileSource'; break;               // integer 
     232    case 'a301': $tag = 'SceneType'; break;                // integer 
     233    case 'a302': $tag = 'CFAPattern'; break;               // undefined data type 
     234    case 'a401': $tag = 'CustomerRender'; break;           // values 0 or 1 
     235    case 'a402': $tag = 'ExposureMode'; break;             // values 0-2 
     236    case 'a403': $tag = 'WhiteBalance'; break;             // values 0 or 1