[ PHPXref.com ] [ Generated: Sun Jul 20 19:44:41 2008 ] [ PHP JPEG Metadata 1.11 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> IPTC.php (source)

   1  <?php
   2  
   3  /******************************************************************************

   4  *

   5  * Filename:     IPTC.php

   6  *

   7  * Description:  Provides functions for reading and writing IPTC-NAA Information

   8  *               Interchange Model metadata

   9  *

  10  * Author:       Evan Hunter

  11  *

  12  * Date:         23/7/2004

  13  *

  14  * Project:      PHP JPEG Metadata Toolkit

  15  *

  16  * Revision:     1.10

  17  *

  18  * Changes:      1.00 -> 1.01 : changed get_IPTC to return partial data when error occurs

  19  *               1.01 -> 1.10 : changed put_IPTC to check if the incoming IPTC block is valid

  20  *                              changed Interpret_IPTC_to_HTML, adding nl2br functions for each text field,

  21  *                              so that multiline text displays properly

  22  *

  23  * URL:          http://electronics.ozhiker.com

  24  *

  25  * Copyright:    Copyright Evan Hunter 2004

  26  *

  27  * License:      This file is part of the PHP JPEG Metadata Toolkit.

  28  *

  29  *               The PHP JPEG Metadata Toolkit is free software; you can

  30  *               redistribute it and/or modify it under the terms of the

  31  *               GNU General Public License as published by the Free Software

  32  *               Foundation; either version 2 of the License, or (at your

  33  *               option) any later version.

  34  *

  35  *               The PHP JPEG Metadata Toolkit is distributed in the hope

  36  *               that it will be useful, but WITHOUT ANY WARRANTY; without

  37  *               even the implied warranty of MERCHANTABILITY or FITNESS

  38  *               FOR A PARTICULAR PURPOSE.  See the GNU General Public License

  39  *               for more details.

  40  *

  41  *               You should have received a copy of the GNU General Public

  42  *               License along with the PHP JPEG Metadata Toolkit; if not,

  43  *               write to the Free Software Foundation, Inc., 59 Temple

  44  *               Place, Suite 330, Boston, MA  02111-1307  USA

  45  *

  46  *               If you require a different license for commercial or other

  47  *               purposes, please contact the author: evan@ozhiker.com

  48  *

  49  ******************************************************************************/
  50  
  51  
  52  // TODO: Not all of the IPTC fields have been tested properly

  53  
  54  /******************************************************************************

  55  *

  56  * Function:     get_IPTC

  57  *

  58  * Description:  Extracts IPTC-NAA IIM data from the string provided, and returns

  59  *               the information as an array

  60  *

  61  * Parameters:   Data_Str - the string containing the IPTC-NAA IIM records. Must

  62  *                          be exact length of the IPTC-NAA IIM data.

  63  *

  64  * Returns:      OutputArray - Array of IPTC-NAA IIM records

  65  *               FALSE - If an error occured in decoding

  66  *

  67  ******************************************************************************/
  68  
  69  function get_IPTC( $Data_Str )
  70  {
  71  
  72          // Initialise the start position

  73          $pos = 0;
  74          // Create the array to receive the data

  75          $OutputArray = array( );
  76  
  77          // Cycle through the IPTC records, decoding and storing them

  78          while( $pos < strlen($Data_Str) )
  79          {
  80                  // TODO - Extended Dataset record not supported

  81  
  82                  // Check if there is sufficient data for reading the record

  83                  if ( strlen( substr($Data_Str,$pos) ) < 5 )
  84                  {
  85                          // Not enough data left for a record - Probably corrupt data - ERROR

  86                          // Change: changed to return partial data as of revision 1.01

  87                          return $OutputArray;
  88                  }
  89  
  90                  // Unpack data from IPTC record:

  91                  // First byte - IPTC Tag Marker - always 28

  92                  // Second byte - IPTC Record Number

  93                  // Third byte - IPTC Dataset Number

  94                  // Fourth and fifth bytes - two byte size value

  95                  $iptc_raw = unpack( "CIPTC_Tag_Marker/CIPTC_Record_No/CIPTC_Dataset_No/nIPTC_Size", substr($Data_Str,$pos) );
  96  
  97                  // Skip position over the unpacked data

  98                  $pos += 5;
  99  
 100                  // Construct the IPTC type string eg 2:105

 101                  $iptctype = sprintf( "%01d:%02d", $iptc_raw['IPTC_Record_No'], $iptc_raw['IPTC_Dataset_No']);
 102  
 103                  // Check if there is sufficient data for reading the record contents

 104                  if ( strlen( substr( $Data_Str, $pos, $iptc_raw['IPTC_Size'] ) ) !== $iptc_raw['IPTC_Size'] )
 105                  {
 106                          // Not enough data left for the record content - Probably corrupt data - ERROR

 107                          // Change: changed to return partial data as of revision 1.01

 108                          return $OutputArray;
 109                  }
 110  
 111                  // Add the IPTC record to the output array

 112                  $OutputArray[] = array( "IPTC_Type" => $iptctype ,
 113                                          "RecName" => $GLOBALS[ "IPTC_Entry_Names" ][ $iptctype ],
 114                                          "RecDesc" => $GLOBALS[ "IPTC_Entry_Descriptions" ][ $iptctype ],
 115                                          "RecData" => substr( $Data_Str, $pos, $iptc_raw['IPTC_Size'] ) );
 116  
 117                  // Skip over the IPTC record data

 118                  $pos += $iptc_raw['IPTC_Size'];
 119          }
 120          return $OutputArray;
 121  
 122  }
 123  
 124  
 125  /******************************************************************************

 126  * End of Function:     get_IPTC

 127  ******************************************************************************/
 128  
 129  
 130  
 131  
 132  /******************************************************************************

 133  *

 134  * Function:     put_IPTC

 135  *

 136  * Description:  Encodes an array of IPTC-NAA records into a string encoded

 137  *               as IPTC-NAA IIM. (The reverse of get_IPTC)

 138  *

 139  * Parameters:   new_IPTC_block - the IPTC-NAA array to be encoded. Should be

 140  *                                the same format as that received from get_IPTC

 141  *

 142  * Returns:      iptc_packed_data - IPTC-NAA IIM encoded string

 143  *

 144  ******************************************************************************/
 145  
 146  
 147  function put_IPTC( $new_IPTC_block )
 148  {
 149          // Check if the incoming IPTC block is valid

 150          if ( $new_IPTC_block == FALSE )
 151          {
 152                  // Invalid IPTC block - abort

 153                  return FALSE;
 154          }
 155          // Initialise the packed output data string

 156          $iptc_packed_data = "";
 157  
 158          // Cycle through each record in the new IPTC block

 159          foreach ($new_IPTC_block as $record)
 160          {
 161                  // Extract the Record Number and Dataset Number from the IPTC_Type field

 162                  list($IPTC_Record, $IPTC_Dataset) = sscanf( $record['IPTC_Type'], "%d:%d");
 163  
 164                  // Write the IPTC-NAA IIM Tag Marker, Record Number, Dataset Number and Data Size to the packed output data string

 165                  $iptc_packed_data .= pack( "CCCn", 28, $IPTC_Record, $IPTC_Dataset, strlen($record['RecData']) );
 166  
 167                  // Write the IPTC-NAA IIM Data to the packed output data string

 168                  $iptc_packed_data .= $record['RecData'];
 169          }
 170  
 171          // Return the IPTC-NAA IIM data

 172          return $iptc_packed_data;
 173  }
 174  
 175  /******************************************************************************

 176  * End of Function:     put_IPTC

 177  ******************************************************************************/
 178  
 179  
 180  
 181  /******************************************************************************

 182  *

 183  * Function:     Interpret_IPTC_to_HTML

 184  *

 185  * Description:  Generates html detailing the contents a IPTC-NAA IIM array

 186  *               which was retrieved with the get_IPTC function

 187  *

 188  * Parameters:   IPTC_info - the IPTC-NAA IIM array,as read from get_IPTC

 189  *

 190  * Returns:      OutputStr - A string containing the HTML

 191  *

 192  ******************************************************************************/
 193  
 194  function Interpret_IPTC_to_HTML( $IPTC_info )
 195  {
 196          // Create a string to receive the HTML

 197          $output_str ="";
 198  
 199          // Check if the IPTC

 200          if ( $IPTC_info !== FALSE )
 201          {
 202  
 203  
 204                  // Add Heading to HTML

 205                  $output_str .= "<h3 class=\"IPTC_Main_Heading\">IPTC-NAA Record</h3>\n";
 206  
 207                  // Add Table to HTML

 208                  $output_str .= "\n<table class=\"IPTC_Table\" border=1>\n";
 209  
 210                  // Cycle through each of the IPTC-NAA IIM records

 211                  foreach( $IPTC_info as $IPTC_Record )
 212                  {
 213                          // Check if the record is a known IPTC field

 214                          $Record_Name = $IPTC_Record['RecName'];
 215                          if ( $Record_Name == "" )
 216                          {
 217                                  // Record is an unknown field - add message to HTML

 218                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">Unknown IPTC field '". htmlentities( $IPTC_Record['IPTC_Type'] ). "' :</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 219                          }
 220                          else
 221                          {
 222                                  // Record is a recognised IPTC field - Process it accordingly

 223  
 224                                  switch ( $IPTC_Record['IPTC_Type'] )
 225                                  {
 226                                          case "1:00":    // Envelope Record:Model Version
 227                                          case "1:22":    // Envelope Record:File Format Version
 228                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" . hexdec( bin2hex( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 229                                                  break;
 230  
 231                                          case "1:90":    // Envelope Record:Coded Character Set
 232                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Decoding not yet implemented<br>\n (Hex Data: " . bin2hex( $IPTC_Record['RecData'] )  .")</td></tr>\n";
 233                                                  break;
 234                                                  // TODO: Implement decoding of IPTC record 1:90

 235  
 236                                          case "1:20":    // Envelope Record:File Format
 237  
 238                                                  $formatno = hexdec( bin2hex( $IPTC_Record['RecData'] ) );
 239  
 240                                                  // Lookup file format from lookup-table

 241                                                  if ( array_key_exists( $formatno, $GLOBALS[ "IPTC_File Formats" ] ) )
 242                                                  {
 243                                                          // Entry was found in lookup table - add it to HTML

 244                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">File Format</td><td class=\"IPTC_Value_Cell\">". $GLOBALS[ "IPTC_File Formats" ][$formatno] . "</td></tr>\n";
 245                                                  }
 246                                                  else
 247                                                  {
 248                                                          // No matching entry was found in lookup table - add message to html

 249                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">File Format</td><td class=\"IPTC_Value_Cell\">Unknown File Format ($formatno)</td></tr>\n";
 250                                                  }
 251                                                  break;
 252  
 253  
 254                                          case "2:00":    // Application Record:Record Version
 255                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">IPTC Version</td><td class=\"IPTC_Value_Cell\">" . hexdec( bin2hex( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 256                                                  break;
 257  
 258                                          case "2:42":    // Application Record: Action Advised
 259  
 260                                                  // Looup Action

 261                                                  if ( $IPTC_Record['RecData'] == "01" )
 262                                                  {
 263                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Kill</td></tr>\n";
 264                                                  }
 265                                                  elseif ( $IPTC_Record['RecData'] == "02" )
 266                                                  {
 267                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Replace</td></tr>\n";
 268                                                  }
 269                                                  elseif ( $IPTC_Record['RecData'] == "03" )
 270                                                  {
 271                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Append</td></tr>\n";
 272                                                  }
 273                                                  elseif ( $IPTC_Record['RecData'] == "04" )
 274                                                  {
 275                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Reference</td></tr>\n";
 276                                                  }
 277                                                  else
 278                                                  {
 279                                                          // Unknown Action

 280                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 281                                                  }
 282                                                  break;
 283  
 284                                          case "2:08":    // Application Record:Editorial Update
 285                                                  if ( $IPTC_Record['RecData'] == "01" )
 286                                                  {
 287                                                          // Additional Language

 288                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Additional language</td></tr>\n";
 289                                                  }
 290                                                  else
 291                                                  {
 292                                                          // Unknown Value

 293                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 294                                                  }
 295                                                  break;
 296  
 297                                          case "2:30":    // Application Record:Release Date
 298                                          case "2:37":    // Application Record:Expiration Date
 299                                          case "2:47":    // Application Record:Reference Date
 300                                          case "2:55":    // Application Record:Date Created
 301                                          case "2:62":    // Application Record:Digital Creation Date
 302                                          case "1:70":    // Envelope Record:Date Sent
 303                                                  $date_array = unpack( "a4Year/a2Month/A2Day", $IPTC_Record['RecData'] );
 304                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $date_array['Day'] . "/" . $date_array['Month'] . "/" . $date_array['Year'] ) ) ."</td></tr>\n";
 305                                                  break;
 306  
 307                                          case "2:35":    // Application Record:Release Time
 308                                          case "2:38":    // Application Record:Expiration Time
 309                                          case "2:60":    // Application Record:Time Created
 310                                          case "2:63":    // Application Record:Digital Creation Time
 311                                          case "1:80":    // Envelope Record:Time Sent
 312                                                  $time_array = unpack( "a2Hour/a2Minute/A2Second/APlusMinus/A4Timezone", $IPTC_Record['RecData'] );
 313                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" . nl2br( HTML_UTF8_Escape( $time_array['Hour'] . ":" . $time_array['Minute'] . ":" . $time_array['Second'] . " ". $time_array['PlusMinus'] . $time_array['Timezone'] ) ) ."</td></tr>\n";
 314                                                  break;
 315  
 316                                          case "2:75":    // Application Record:Object Cycle
 317                                                  // Lookup Value

 318                                                  if ( $IPTC_Record['RecData'] == "a" )
 319                                                  {
 320                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Morning</td></tr>\n";
 321                                                  }
 322                                                  elseif ( $IPTC_Record['RecData'] == "p" )
 323                                                  {
 324                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Evening</td></tr>\n";
 325                                                  }
 326                                                  elseif ( $IPTC_Record['RecData'] == "b" )
 327                                                  {
 328                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Both Morning and Evening</td></tr>\n";
 329                                                  }
 330                                                  else
 331                                                  {
 332                                                          // Unknown Value

 333                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 334                                                  }
 335                                                  break;
 336  
 337                                          case "2:125":   // Application Record:Rasterised Caption
 338                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">460x128 pixel black and white caption image</td></tr>\n";
 339                                                  break;
 340                                                  // TODO: Display Rasterised Caption for IPTC record 2:125

 341  
 342                                          case "2:130":   // Application Record:Image Type
 343                                                  // Lookup Number of Components

 344                                                  if ( $IPTC_Record['RecData']{0} == "0" )
 345                                                  {
 346                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">No Objectdata";
 347                                                  }
 348                                                  elseif ( $IPTC_Record['RecData']{0} == "9" )
 349                                                  {
 350                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Supplemental objects related to other objectdata";
 351                                                  }
 352                                                  else
 353                                                  {
 354                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Number of Colour Components : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData']{0} ) );
 355                                                  }
 356  
 357                                                  // Lookup current objectdata colour

 358                                                  if ( $GLOBALS['ImageType_Names'][ $IPTC_Record['RecData']{1} ] == "" )
 359                                                  {
 360                                                          $output_str .= ", Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData']{1} ) );
 361                                                  }
 362                                                  else
 363                                                  {
 364                                                          $output_str .= ", " . nl2br( HTML_UTF8_Escape( $GLOBALS['ImageType_Names'][ $IPTC_Record['RecData']{1} ] ) );
 365                                                  }
 366                                                  $output_str .= "</td></tr>\n";
 367                                                  break;
 368  
 369                                          case "2:131":   // Application Record:Image Orientation
 370                                                  // Lookup value

 371                                                  if ( $IPTC_Record['RecData'] == "L" )
 372                                                  {
 373                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Landscape</td></tr>\n";
 374                                                  }
 375                                                  elseif ( $IPTC_Record['RecData'] == "P" )
 376                                                  {
 377                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Portrait</td></tr>\n";
 378                                                  }
 379                                                  elseif ( $IPTC_Record['RecData'] == "S" )
 380                                                  {
 381                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Square</td></tr>\n";
 382                                                  }
 383                                                  else
 384                                                  {
 385                                                          // Unknown Orientation Value

 386                                                          $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">Unknown : " . nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 387                                                  }
 388                                                  break;
 389  
 390                                          default:        // All other records
 391                                                  $output_str .= "<tr class=\"IPTC_Table_Row\"><td class=\"IPTC_Caption_Cell\">$Record_Name</td><td class=\"IPTC_Value_Cell\">" .nl2br( HTML_UTF8_Escape( $IPTC_Record['RecData'] ) ) ."</td></tr>\n";
 392                                                  break;
 393                                  }
 394                          }
 395                  }
 396  
 397                  // Add Table End to HTML

 398                  $output_str .= "</table><br>\n";
 399          }
 400  
 401          // Return HTML

 402          return $output_str;
 403  }
 404  
 405  
 406  /******************************************************************************

 407  * End of Function:     Interpret_IPTC_to_HTML

 408  ******************************************************************************/
 409  
 410  
 411  
 412  /******************************************************************************

 413  * Global Variable:      IPTC_Entry_Names

 414  *

 415  * Contents:     The names of the IPTC-NAA IIM fields

 416  *

 417  ******************************************************************************/
 418  
 419  $GLOBALS[ "IPTC_Entry_Names" ] = array(
 420  // Envelope Record

 421  "1:00" => "Model Version",
 422  "1:05" => "Destination",
 423  "1:20" => "File Format",
 424  "1:22" => "File Format Version",
 425  "1:30" => "Service Identifier",
 426  "1:40" => "Envelope Number",
 427  "1:50" => "Product ID",
 428  "1:60" => "Envelope Priority",
 429  "1:70" => "Date Sent",
 430  "1:80" => "Time Sent",
 431  "1:90" => "Coded Character Set",
 432  "1:100" => "UNO (Unique Name of Object)",
 433  "1:120" => "ARM Identifier",
 434  "1:122" => "ARM Version",
 435  
 436  // Application Record

 437  "2:00" => "Record Version",
 438  "2:03" => "Object Type Reference",
 439  "2:05" => "Object Name (Title)",
 440  "2:07" => "Edit Status",
 441  "2:08" => "Editorial Update",
 442  "2:10" => "Urgency",
 443  "2:12" => "Subject Reference",
 444  "2:15" => "Category",
 445  "2:20" => "Supplemental Category",
 446  "2:22" => "Fixture Identifier",
 447  "2:25" => "Keywords",
 448  "2:26" => "Content Location Code",
 449  "2:27" => "Content Location Name",
 450  "2:30" => "Release Date",
 451  "2:35" => "Release Time",
 452  "2:37" => "Expiration Date",
 453  "2:35" => "Expiration Time",
 454  "2:40" => "Special Instructions",
 455  "2:42" => "Action Advised",
 456  "2:45" => "Reference Service",
 457  "2:47" => "Reference Date",
 458  "2:50" => "Reference Number",
 459  "2:55" => "Date Created",
 460  "2:60" => "Time Created",
 461  "2:62" => "Digital Creation Date",
 462  "2:63" => "Digital Creation Time",
 463  "2:65" => "Originating Program",
 464  "2:70" => "Program Version",
 465  "2:75" => "Object Cycle",
 466  "2:80" => "By-Line (Author)",
 467  "2:85" => "By-Line Title (Author Position) [Not used in Photoshop 7]",
 468  "2:90" => "City",
 469  "2:92" => "Sub-Location",
 470  "2:95" => "Province/State",
 471  "2:100" => "Country/Primary Location Code",
 472  "2:101" => "Country/Primary Location Name",
 473  "2:103" => "Original Transmission Reference",
 474  "2:105" => "Headline",
 475  "2:110" => "Credit",
 476  "2:115" => "Source",
 477  "2:116" => "Copyright Notice",
 478  "2:118" => "Contact",
 479  "2:120" => "Caption/Abstract",
 480  "2:122" => "Caption Writer/Editor",
 481  "2:125" => "Rasterized Caption",
 482  "2:130" => "Image Type",
 483  "2:131" => "Image Orientation",
 484  "2:135" => "Language Identifier",
 485  "2:150" => "Audio Type",
 486  "2:151" => "Audio Sampling Rate",
 487  "2:152" => "Audio Sampling Resolution",
 488  "2:153" => "Audio Duration",
 489  "2:154" => "Audio Outcue",
 490  "2:200" => "ObjectData Preview File Format",
 491  "2:201" => "ObjectData Preview File Format Version",
 492  "2:202" => "ObjectData Preview Data",
 493  
 494  // Pre-ObjectData Descriptor Record

 495  "7:10"  => "Size Mode",
 496  "7:20"  => "Max Subfile Size",
 497  "7:90"  => "ObjectData Size Announced",
 498  "7:95"  => "Maximum ObjectData Size",
 499  
 500  // ObjectData Record

 501  "8:10"  => "Subfile",
 502  
 503  // Post ObjectData Descriptor Record

 504  "9:10"  => "Confirmed ObjectData Size"
 505  
 506  );
 507  
 508  /******************************************************************************

 509  * End of Global Variable:     IPTC_Entry_Names

 510  ******************************************************************************/
 511  
 512  
 513  
 514  
 515  
 516  /******************************************************************************

 517  * Global Variable:      IPTC_Entry_Descriptions

 518  *

 519  * Contents:     The Descriptions of the IPTC-NAA IIM fields

 520  *

 521  ******************************************************************************/
 522  
 523  $GLOBALS[ "IPTC_Entry_Descriptions" ] = array(
 524  // Envelope Record

 525  "1:00" => "2 byte binary version number",
 526  "1:05" => "Max 1024 characters of Destination",
 527  "1:20" => "2 byte binary file format number, see IPTC-NAA V4 Appendix A",
 528  "1:22" => "Binary version number of file format",
 529  "1:30" => "Max 10 characters of Service Identifier",
 530  "1:40" => "8 Character Envelope Number",
 531  "1:50" => "Product ID - Max 32 characters",
 532  "1:60" => "Envelope Priority - 1 numeric characters",
 533  "1:70" => "Date Sent - 8 numeric characters CCYYMMDD",
 534  "1:80" => "Time Sent - 11 characters HHMMSS±HHMM",
 535  "1:90" => "Coded Character Set - Max 32 characters",
 536  "1:100" => "UNO (Unique Name of Object) - 14 to 80 characters",
 537  "1:120" => "ARM Identifier - 2 byte binary number",
 538  "1:122" => "ARM Version - 2 byte binary number",
 539  
 540  // Application Record

 541  "2:00" => "Record Version - 2 byte binary number",
 542  "2:03" => "Object Type Reference -  3 plus 0 to 64 Characters",
 543  "2:05" => "Object Name (Title) - Max 64 characters",
 544  "2:07" => "Edit Status - Max 64 characters",
 545  "2:08" => "Editorial Update - 2 numeric characters",
 546  "2:10" => "Urgency - 1 numeric character",
 547  "2:12" => "Subject Reference - 13 to 236 characters",
 548  "2:15" => "Category - Max 3 characters",
 549  "2:20" => "Supplemental Category - Max 32 characters",
 550  "2:22" => "Fixture Identifier - Max 32 characters",
 551  "2:25" => "Keywords - Max 64 characters",
 552  "2:26" => "Content Location Code - 3 characters",
 553  "2:27" => "Content Location Name - Max 64 characters",
 554  "2:30" => "Release Date - 8 numeric characters CCYYMMDD",
 555  "2:35" => "Release Time - 11 characters HHMMSS±HHMM",
 556  "2:37" => "Expiration Date - 8 numeric characters CCYYMMDD",
 557  "2:35" => "Expiration Time - 11 characters HHMMSS±HHMM",
 558  "2:40" => "Special Instructions - Max 256 Characters",
 559  "2:42" => "Action Advised - 2 numeric characters",
 560  "2:45" => "Reference Service - Max 10 characters",
 561  "2:47" => "Reference Date - 8 numeric characters CCYYMMDD",
 562  "2:50" => "Reference Number - 8 characters",
 563  "2:55" => "Date Created - 8 numeric characters CCYYMMDD",
 564  "2:60" => "Time Created - 11 characters HHMMSS±HHMM",
 565  "2:62" => "Digital Creation Date - 8 numeric characters CCYYMMDD",
 566  "2:63" => "Digital Creation Time - 11 characters HHMMSS±HHMM",
 567  "2:65" => "Originating Program - Max 32 characters",
 568  "2:70" => "Program Version - Max 10 characters",
 569  "2:75" => "Object Cycle - 1 character",
 570  "2:80" => "By-Line (Author) - Max 32 Characters",
 571  "2:85" => "By-Line Title (Author Position) - Max 32 characters",
 572  "2:90" => "City - Max 32 Characters",
 573  "2:92" => "Sub-Location - Max 32 characters",
 574  "2:95" => "Province/State - Max 32 Characters",
 575  "2:100" => "Country/Primary Location Code - 3 alphabetic characters",
 576  "2:101" => "Country/Primary Location Name - Max 64 characters",
 577  "2:103" => "Original Transmission Reference - Max 32 characters",
 578  "2:105" => "Headline - Max 256 Characters",
 579  "2:110" => "Credit - Max 32 Characters",
 580  "2:115" => "Source - Max 32 Characters",
 581  "2:116" => "Copyright Notice - Max 128 Characters",
 582  "2:118" => "Contact - Max 128 characters",
 583  "2:120" => "Caption/Abstract - Max 2000 Characters",
 584  "2:122" => "Caption Writer/Editor - Max 32 Characters",
 585  "2:125" => "Rasterized Caption - 7360 bytes, 1 bit per pixel, 460x128pixel image",
 586  "2:130" => "Image Type - 2 characters",
 587  "2:131" => "Image Orientation - 1 alphabetic character",
 588  "2:135" => "Language Identifier - 2 or 3 aphabetic characters",
 589  "2:150" => "Audio Type - 2 characters",
 590  "2:151" => "Audio Sampling Rate - 6 numeric characters",
 591  "2:152" => "Audio Sampling Resolution - 2 numeric characters",
 592  "2:153" => "Audio Duration - 6 numeric characters",
 593  "2:154" => "Audio Outcue - Max 64 characters",
 594  "2:200" => "ObjectData Preview File Format - 2 byte binary number",
 595  "2:201" => "ObjectData Preview File Format Version - 2 byte binary number",
 596  "2:202" => "ObjectData Preview Data - Max 256000 binary bytes",
 597  
 598  // Pre-ObjectData Descriptor Record

 599  "7:10"  => "Size Mode - 1 numeric character",
 600  "7:20"  => "Max Subfile Size",
 601  "7:90"  => "ObjectData Size Announced",
 602  "7:95"  => "Maximum ObjectData Size",
 603  
 604  // ObjectData Record

 605  "8:10"  => "Subfile",
 606  
 607  // Post ObjectData Descriptor Record

 608  "9:10"  => "Confirmed ObjectData Size"
 609  
 610  );
 611  
 612  /******************************************************************************

 613  * End of Global Variable:     IPTC_Entry_Descriptions

 614  ******************************************************************************/
 615  
 616  
 617  
 618  
 619  /******************************************************************************

 620  * Global Variable:      IPTC_File Formats

 621  *

 622  * Contents:     The names of the IPTC-NAA IIM File Formats for field 1:20

 623  *

 624  ******************************************************************************/
 625  
 626  $GLOBALS[ "IPTC_File Formats" ] = array(
 627  00 => "No ObjectData",
 628  01 => "IPTC-NAA Digital Newsphoto Parameter Record",
 629  02 => "IPTC7901 Recommended Message Format",
 630  03 => "Tagged Image File Format (Adobe/Aldus Image data)",
 631  04 => "Illustrator (Adobe Graphics data)",
 632  05 => "AppleSingle (Apple Computer Inc)",
 633  06 => "NAA 89-3 (ANPA 1312)",
 634  07 => "MacBinary II",
 635  08 => "IPTC Unstructured Character Oriented File Format (UCOFF)",
 636  09 => "United Press International ANPA 1312 variant",
 637  10 => "United Press International Down-Load Message",
 638  11 => "JPEG File Interchange (JFIF)",
 639  12 => "Photo-CD Image-Pac (Eastman Kodak)",
 640  13 => "Microsoft Bit Mapped Graphics File [*.BMP]",
 641  14 => "Digital Audio File [*.WAV] (Microsoft & Creative Labs)",
 642  15 => "Audio plus Moving Video [*.AVI] (Microsoft)",
 643  16 => "PC DOS/Windows Executable Files [*.COM][*.EXE]",
 644  17 => "Compressed Binary File [*.ZIP] (PKWare Inc)",
 645  18 => "Audio Interchange File Format AIFF (Apple Computer Inc)",
 646  19 => "RIFF Wave (Microsoft Corporation)",
 647  20 => "Freehand (Macromedia/Aldus)",
 648  21 => "Hypertext Markup Language - HTML (The Internet Society)",
 649  22 => "MPEG 2 Audio Layer 2 (Musicom), ISO/IEC",
 650  23 => "MPEG 2 Audio Layer 3, ISO/IEC",
 651  24 => "Portable Document File (*.PDF) Adobe",
 652  25 => "News Industry Text Format (NITF)",
 653  26 => "Tape Archive (*.TAR)",
 654  27 => "Tidningarnas Telegrambyrå NITF version (TTNITF DTD)",
 655  28 => "Ritzaus Bureau NITF version (RBNITF DTD)",
 656  29 => "Corel Draw [*.CDR]"
 657  );
 658  
 659  
 660  /******************************************************************************

 661  * End of Global Variable:     IPTC_File Formats

 662  ******************************************************************************/
 663  
 664  /******************************************************************************

 665  * Global Variable:      ImageType_Names

 666  *

 667  * Contents:     The names of the colour components for IPTC-NAA IIM field 2:130

 668  *

 669  ******************************************************************************/
 670  
 671  $GLOBALS['ImageType_Names'] = array(    "M" => "Monochrome",
 672                                          "Y" => "Yellow Component",
 673                                          "M" => "Magenta Component",
 674                                          "C" => "Cyan Component",
 675                                          "K" => "Black Component",
 676                                          "R" => "Red Component",
 677                                          "G" => "Green Component",
 678                                          "B" => "Blue Component",
 679                                          "T" => "Text Only",
 680                                          "F" => "Full colour composite, frame sequential",
 681                                          "L" => "Full colour composite, line sequential",
 682                                          "P" => "Full colour composite, pixel sequential",
 683                                          "S" => "Full colour composite, special interleaving" );
 684  
 685  
 686  
 687  /******************************************************************************

 688  * End of Global Variable:     ImageType_Names

 689  ******************************************************************************/
 690  
 691  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]