summaryrefslogtreecommitdiff
path: root/includes/jpeg_metadata_tk/Makernotes
diff options
context:
space:
mode:
Diffstat (limited to 'includes/jpeg_metadata_tk/Makernotes')
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/Pentax.php353
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/agfa.php117
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/canon.php748
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/casio.php575
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/epson.php119
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/fujifilm.php344
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/konica_minolta.php745
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/kyocera.php241
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/nikon.php731
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/olympus.php486
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/panasonic.php292
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/ricoh.php415
-rw-r--r--includes/jpeg_metadata_tk/Makernotes/sony.php244
13 files changed, 5410 insertions, 0 deletions
diff --git a/includes/jpeg_metadata_tk/Makernotes/Pentax.php b/includes/jpeg_metadata_tk/Makernotes/Pentax.php
new file mode 100644
index 0000000..10194a6
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/Pentax.php
@@ -0,0 +1,353 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: pentax.php
+*
+* Description: Pentax (Asahi) Makernote Parser
+* Provides functions to decode an Pentax (Asahi) EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Pentax Makernote Format:
+*
+* Type 1
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* IFD Data Variable NON-Standard IFD Data using Pentax Tags
+* IFD has no Next-IFD pointer at end of IFD,
+* and Offsets are relative to the start
+* of the current IFD tag, not the TIFF header
+* ----------------------------------------------------------------
+*
+*
+* Type 2
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 4 Bytes "AOC\x00"
+* Unknown 2 Bytes Unknown field
+* IFD Data Variable NON-Standard IFD Data using Casio Type 2 Tags
+* IFD has no Next-IFD pointer at end of IFD,
+* and Offsets are relative to the start
+* of the current IFD tag, not the TIFF header
+* ----------------------------------------------------------------
+*
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+// Pentax Type 2 makernote uses Casio Type 2 tags - ensure they are included
+
+include_once 'casio.php';
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Pentax_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Pentax_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Pentax_Makernote_Html";
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Pentax_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Pentax_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+ // Check if the Make Field contains the word Pentax or Asahi
+ if ( ( stristr( $Make_Field, "Pentax" ) === FALSE ) &&
+ ( stristr( $Make_Field, "Asahi" ) === FALSE ) )
+ {
+ // Couldn't find Pentax or Asahi in the maker - abort
+ return FALSE;
+ }
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'], 0, 4 ) == "AOC\x00" )
+ {
+ // Type 2 Pentax Makernote
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 6 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Casio Type 2" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Casio Type 2";
+ $Makernote_Tag['Makernote Tags'] = "Casio Type 2";
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+ else
+ {
+ // Type 1 Penax Makernote
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 0 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Pentax" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Pentax";
+ $Makernote_Tag['Makernote Tags'] = "Pentax";
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+
+
+ // Shouldn't get here
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Pentax_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Pentax_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Pentax_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Pentax_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+ // Check that this tag uses the Pentax tags, otherwise it can't be interpreted here
+ if ( $Tag_Definitions_Name == "Pentax" )
+ {
+ // No Special Tags so far
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Pentax_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Pentax_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Pentax_Makernote_Html( $Makernote_tag, $filename )
+{
+ // Check that this is a Pentax type makernote
+ if ( $Makernote_tag['Makernote Type'] != "Pentax" )
+ {
+ // Not a Pentax makernote - abort
+ return False;
+ }
+
+ // Interpret the IFD and return the html
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Pentax_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Pentax
+*
+* Contents: This global variable provides definitions of the known Pentax Type 1
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Pentax"] = array(
+
+
+0x0001 => array( 'Name' => "Capture Mode",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "Night-scene",
+ 2 => "Manual",
+ 4 => "Multiple" ),
+
+0x0002 => array( 'Name' => "Quality Level",
+ 'Type' => "Lookup",
+ 0 => "Good",
+ 1 => "Better",
+ 2 => "Best" ),
+
+0x0003 => array( 'Name' => "Focus Mode",
+ 'Type' => "Lookup",
+ 2 => "Custom",
+ 3 => "Auto" ),
+
+0x0004 => array( 'Name' => "Flash Mode",
+ 'Type' => "Lookup",
+ 1 => "Auto",
+ 2 => "Flash on",
+ 4 => "Flash off",
+ 6 => "Red-eye Reduction" ),
+
+0x0007 => array( 'Name' => "White Balance",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "Daylight",
+ 2 => "Shade",
+ 3 => "Tungsten",
+ 4 => "Fluorescent",
+ 5 => "Manual" ),
+
+
+0x000a => array( 'Name' => "Digital Zoom",
+ 'Type' => "Numeric",
+ 'Units' => " (0 = Off)" ),
+
+0x000b => array( 'Name' => "Sharpness",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Soft",
+ 2 => "Hard" ),
+
+0x000c => array( 'Name' => "Contrast",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Low",
+ 2 => "High" ),
+
+0x000d => array( 'Name' => "Saturation",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Low",
+ 2 => "High" ),
+
+0x0014 => array( 'Name' => "ISO Speed",
+ 'Type' => "Lookup",
+ 10 => "100",
+ 16 => "200",
+ 100 => "100",
+ 200 => "200" ),
+
+0x0017 => array( 'Name' => "Colour",
+ 'Type' => "Lookup",
+ 1 => "Normal",
+ 2 => "Black & White",
+ 3 => "Sepia" ),
+
+0x0e00 => array( 'Name' => "Print Image Matching Info",
+ 'Type' => "PIM" ),
+
+0x1000 => array( 'Name' => "Time Zone",
+ 'Type' => "String" ),
+
+0x1001 => array( 'Name' => "Daylight Savings",
+ 'Type' => "String" ),
+
+
+
+
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Pentax
+******************************************************************************/
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/agfa.php b/includes/jpeg_metadata_tk/Makernotes/agfa.php
new file mode 100644
index 0000000..214c70d
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/agfa.php
@@ -0,0 +1,117 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: agfa.php
+*
+* Description: Agfa Makernote Parser
+* Provides functions to decode an Agfa EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Agfa Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 8 Bytes "AGFA \x00\x01"
+* IFD Data Variable Standard IFD Data using Olympus Tags
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+// Agfa makernote uses Olympus tags - ensure they are included
+
+include_once 'olympus.php';
+
+
+
+// Add the Parser function to the list of Makernote Parsers. (Interpreter Functions are supplied by the Olympus script)
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Agfa_Makernote";
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Agfa_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Agfa_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+ // Check if the Make Field contains the word Agfa
+ if ( stristr( $Make_Field, "Agfa" ) === FALSE )
+ {
+ // The Make Field doesnt contain the word Agfa
+ return FALSE;
+ }
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'], 0, 7 ) != "AGFA \x00\x01" )
+ {
+ // This isn't a Agfa Makernote, abort
+ return FALSE ;
+ }
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 8 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Olympus" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Agfa";
+ $Makernote_Tag['Makernote Tags'] = "Olympus";
+
+ // Return the new tag
+ return $Makernote_Tag;
+
+}
+
+/******************************************************************************
+* End of Function: get_Agfa_Makernote
+******************************************************************************/
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/canon.php b/includes/jpeg_metadata_tk/Makernotes/canon.php
new file mode 100644
index 0000000..a261506
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/canon.php
@@ -0,0 +1,748 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: canon.php
+*
+* Description: Canon Makernote Parser
+* Provides functions to decode an Canon EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Canon Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* IFD Data Variable Standard IFD Data using Canon Tags
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Canon_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Canon_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Canon_Makernote_Html";
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Canon_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Canon_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+ // Check if the Make Field contains the word Canon
+ if ( stristr( $Make_Field, "Canon" ) === FALSE )
+ {
+ // Canon not found in Make Field - can't process this
+ return FALSE;
+ }
+
+ // Seek to the start of the IFD
+
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Canon" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Canon";
+ $Makernote_Tag['Makernote Tags'] = "Canon";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+}
+
+/******************************************************************************
+* End of Function: get_Canon_Makernote
+******************************************************************************/
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Canon_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Canon_Makernote_Html( $Makernote_tag, $filename )
+{
+ // Check that this makernote uses canon tags
+ if ( $Makernote_tag['Makernote Type'] != "Canon" )
+ {
+ // Makernote doesn't use Canon tags - cant Interpret it
+ return FALSE;
+ }
+
+ // Interpret the IFD to html
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Canon_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Canon_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Canon_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Canon_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+
+ // Check that the tag uses Canon Definitions
+ if ( $Tag_Definitions_Name != "Canon" )
+ {
+ // Tag doesn't use Canon definintions - can't process it
+ return FALSE;
+ }
+
+
+ $Tag_ID = $Exif_Tag['Tag Number'];
+
+
+ // Process the special tag according to the tag number
+ switch ( $Tag_ID )
+ {
+
+ // CAMERA SETTINGS 1
+ case 1:
+ // Create an output string
+ $output_str = "";
+
+ // Cycle through each of the camera settings Values
+ foreach( $Exif_Tag['Data'] as $offset => $value )
+ {
+ // Check that the value exists
+ if ( $value !== NULL )
+ {
+ // Process the settings according to their offset
+ if ( $offset == 0 )
+ {
+ // Do Not Show this Field ( Number of Bytes in Tag )
+ }
+ else if ( $offset == 2 )
+ {
+ if ( $value == 0 )
+ {
+ $output_str .= "Self timer not used\n";
+ }
+ else
+ {
+ $output_str .= "Self timer length : ". ($value/10) . " seconds\n";
+ }
+ }
+ else if ( ( $offset == 23 ) && ( $Exif_Tag['Data'][25] != 0 ))
+ {
+ $output_str .= "Maximum Focal Length of Lens: " . ($value / $Exif_Tag['Data'][25]) . "mm\n";
+ }
+ else if ( ( $offset == 24 ) && ( $Exif_Tag['Data'][25] != 0 ))
+ {
+ $output_str .= "Minimum Focal Length of Lens: " . ($value / $Exif_Tag['Data'][25]) . "mm\n";
+ }
+ else if ( $offset == 25 )
+ {
+ // Do Not Show this Field ( Focal Length units per mm )
+ }
+ else if ( $offset == 29 )
+ {
+ if ( $value & 0x4000 == 0x4000 )
+ {
+ $output_str .= "External E-TTL Flash\n";
+ }
+ if ( $value & 0x2000 == 0x2000 )
+ {
+ $output_str .= "Internal Flash\n";
+ }
+ if ( $value & 0x0800 == 0x0800 )
+ {
+ $output_str .= "Flash FP sync used\n";
+ }
+ if ( $value & 0x0080 == 0x0080 )
+ {
+ $output_str .= "Second (Rear) curtain flash sync used\n";
+ }
+ if ( $value & 0x0008 == 0x0008 )
+ {
+ $output_str .= "Flash FP sync enabled\n";
+ }
+
+ }
+ else if ( array_key_exists( $offset, $GLOBALS[ "Canon_Camera_Settings_1_Tag_Values" ] ) )
+ {
+ if ( array_key_exists( $value, $GLOBALS[ "Canon_Camera_Settings_1_Tag_Values" ][$offset] ) )
+ {
+ $output_str .= $GLOBALS[ "Canon_Camera_Settings_1_Tag_Values" ][$offset]['Name'] . ": " . $GLOBALS[ "Canon_Camera_Settings_1_Tag_Values" ][$offset][$value] . "\n";
+ }
+ else
+ {
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= $GLOBALS[ "Canon_Camera_Settings_1_Tag_Values" ][$offset]['Name'] . ": Unknown Value ($value)\n";
+ }
+ }
+ }
+ else
+ {
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ // Unknown Canon camera setting
+ $output_str .= " Unknown Setting ($offset), value: $value\n";
+ }
+ }
+ }
+
+ }
+ // Return the text string
+ return $output_str;
+ break;
+
+
+ // CAMERA SETTINGS 2
+ case 4:
+ // Create an output string
+ $output_str = "";
+
+ // Cycle through each of the camera settings Values
+ foreach( $Exif_Tag['Data'] as $offset => $value )
+ {
+ // Check that the value exists
+ if ( $value !== NULL )
+ {
+ // Process the settings according to their offset
+ if ( $offset == 0 )
+ {
+ // Do Not Show this Field ( Number of Bytes in Tag )
+ }
+ else if ( $offset == 9 )
+ {
+ $output_str .= "Sequence Number in a continuous burst : $value\n";
+ }
+ else if ( $offset == 14 )
+ {
+ $output_str .= "Number of Focus Points Available: ". ( ( $value & 0xF000 ) / 0x1000 ) . "\n";
+
+ if ( $value & 0x0004 == 0x0004 )
+ {
+ $output_str .= "Left Focus Point Used\n";
+ }
+ if ( $value & 0x0002 == 0x0002 )
+ {
+ $output_str .= "Centre Focus Point Used\n";
+ }
+ if ( $value & 0x0001 == 0x0001 )
+ {
+ $output_str .= "Right Focus Point Used\n";
+ }
+ }
+ else if ( $offset == 19 )
+ {
+ $output_str .= "Subject distance: $value (units either mm or cm)\n";
+ }
+ else if ( array_key_exists( $offset, $GLOBALS[ "Canon_Camera_Settings_2_Tag_Values" ] ) )
+ {
+ if ( array_key_exists( $value, $GLOBALS[ "Canon_Camera_Settings_2_Tag_Values" ][$offset] ) )
+ {
+ $output_str .= $GLOBALS[ "Canon_Camera_Settings_2_Tag_Values" ][$offset]['Name'] . ": " . $GLOBALS[ "Canon_Camera_Settings_2_Tag_Values" ][$offset][$value] . "\n";
+ }
+ else
+ {
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= $GLOBALS[ "Canon_Camera_Settings_2_Tag_Values" ][$offset]['Name'] . ": Unknown Value ($value)\n";
+ }
+ }
+ }
+ else
+ {
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= " Unknown Setting ($offset), value: $value\n";
+ }
+ }
+ }
+
+ }
+ // Return the text string
+ return $output_str;
+ break;
+
+
+ // Serial Number
+ case 12:
+ $output_str = sprintf ( "%04X%05d", (($Exif_Tag['Data'][0] & 0xFF00)/256), ($Exif_Tag['Data'][0] & 0x00FF) );
+ break;
+
+
+ // Custom Functions
+ case 15:
+ // Create an output string
+ $output_str = "";
+
+ // The size element is the first of the value array
+ // get rid of it
+ $tmparray = $Exif_Tag['Data'];
+ array_shift ( $tmparray );
+
+ // Cycle through each of the custom functions
+ foreach( $tmparray as $valorder => $value )
+ {
+ // Figure out the function number and value
+ $funcno = ( $value & 0xFF00 ) / 256;
+ $funcval = $value & 0x00FF;
+
+ // Check if the function exists in the lookup table of custom functions
+ if ( array_key_exists( $funcno, $GLOBALS[ "Canon_Custom_Functions_Tag_Values" ] ) )
+ {
+ // Function Exists in lookup table,
+ // Check if value exists for this function in the lookup table
+ if ( array_key_exists( $funcval, $GLOBALS[ "Canon_Custom_Functions_Tag_Values" ][$funcno] ) )
+ {
+ // Value exists - Add it to the output text
+ $output_str .= $GLOBALS[ "Canon_Custom_Functions_Tag_Values" ][$funcno]['Name'] . ": " . $GLOBALS[ "Canon_Custom_Functions_Tag_Values" ][$funcno][$funcval] . "\n";
+ }
+ else
+ {
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ // Value doesn't exist - Add a message to the output text
+ $output_str .= $GLOBALS[ "Canon_Custom_Functions_Tag_Values" ][$funcno]['Name'] . ": Unknown Value ($value)\n";
+ }
+ }
+ }
+ else
+ {
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ // Function doesn't exist in lookup table - add a message to the output text
+ $output_str .= "Unknown Custom Function ($funcno), value: $funcval\n";
+ }
+ }
+ }
+ // Return the resulting string
+ return $output_str;
+ break;
+
+ default :
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Canon_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Canon
+*
+* Contents: This global variable provides definitions of the known Canon
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]['Canon'] = array(
+
+1 => array( 'Name' => "Camera Settings 1",
+ 'Type' => "Special" ),
+
+4 => array( 'Name' => "Camera Settings 2",
+ 'Type' => "Special" ),
+
+6 => array( 'Name' => "Image Type",
+ 'Type' => "String" ),
+
+7 => array( 'Name' => "Firmware Version",
+ 'Type' => "String" ),
+
+8 => array( 'Name' => "Image Number",
+ 'Type' => "Numeric" ),
+
+9 => array( 'Name' => "Owner Name",
+ 'Type' => "String" ),
+
+12 => array( 'Name' => "Camera Serial Number",
+ 'Type' => "Special" ),
+
+15 => array( 'Name' => "Custom Functions",
+ 'Type' => "Special" )
+
+);
+
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Canon
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: Canon_Camera_Settings_1_Tag_Values
+*
+* Contents: This global variable provides definitions for the Canon Camera
+* Settings 1 Makernote tag, indexed by their offset.
+*
+******************************************************************************/
+
+$GLOBALS[ "Canon_Camera_Settings_1_Tag_Values" ] = array(
+
+1 => array( 'Name' => "Macro Mode",
+ 1 => "Macro",
+ 2 => "Normal ( Not Macro )" ),
+
+3 => array( 'Name' => "Quality",
+ 2 => "Normal",
+ 3 => "Fine",
+ 5 => "Superfine" ),
+
+4 => array( 'Name' => "Flash Mode",
+ 0 => "Flash Not Fired",
+ 1 => "Auto",
+ 2 => "On",
+ 3 => "Red Eye Reduction",
+ 4 => "Slow Synchro",
+ 5 => "Auto + Red Eye Reduction",
+ 6 => "On + Red Eye Reduction",
+ 16 => "External Flash" ),
+
+5 => array( 'Name' => "Continuous drive mode",
+ 0 => "Single Frame or Timer Mode",
+ 1 => "Continuous" ),
+
+7 => array( 'Name' => "Focus Mode",
+ 0 => "One-Shot",
+ 1 => "AI Servo",
+ 2 => "AI Focus",
+ 3 => "Manual Focus",
+ 4 => "Single",
+ 5 => "Continuous",
+ 6 => "Manual Focus" ),
+
+10 => array( 'Name' => "Image Size",
+ 0 => "Large",
+ 1 => "Medium",
+ 2 => "Small" ),
+
+11 => array( 'Name' => "Easy shooting Mode",
+ 0 => "Full Auto",
+ 1 => "Manual",
+ 2 => "Landscape",
+ 3 => "Fast Shutter",
+ 4 => "Slow Shutter",
+ 5 => "Night",
+ 6 => "Black & White",
+ 7 => "Sepia",
+ 8 => "Portrait",
+ 9 => "Sports",
+ 10 => "Macro / Close-Up",
+ 11 => "Pan Focus" ),
+
+
+12 => array( 'Name' => "Digital Zoom",
+ 0 => "No Digital Zoom",
+ 1 => "2x",
+ 2 => "4x" ),
+
+13 => array( 'Name' => "Contrast",
+ 0 => "Normal",
+ 1 => "High",
+ 65535 => "Low" ),
+
+14 => array( 'Name' => "Saturation",
+ 0 => "Normal",
+ 1 => "High",
+ 65535 => "Low" ),
+
+15 => array( 'Name' => "Sharpness",
+ 0 => "Normal",
+ 1 => "High",
+ 65535 => "Low" ),
+
+16 => array( 'Name' => "ISO Speed",
+ 0 => "Check ISOSpeedRatings EXIF tag for ISO Speed",
+ 15 => "Auto ISO",
+ 16 => "ISO 50",
+ 17 => "ISO 100",
+ 18 => "ISO 200",
+ 19 => "ISO 400" ),
+
+17 => array( 'Name' => "Metering Mode",
+ 3 => "Evaluative",
+ 4 => "Partial",
+ 5 => "Centre Weighted" ),
+
+18 => array( 'Name' => "Focus Type",
+ 0 => "Manual",
+ 1 => "Auto",
+ 3 => "Close-up (Macro)",
+ 8 => "Locked (Pan Mode)" ),
+
+19 => array( 'Name' => "Auto Focus Point Selected",
+ 12288 => "None (Manual Focus)",
+ 12289 => "Auto Selected",
+ 12290 => "Right",
+ 12291 => "Centre",
+ 12292 => "Left" ),
+
+20 => array( 'Name' => "Exposure Mode",
+ 0 => "Easy Shooting (See Easy Shooting Mode)",
+ 1 => "Program",
+ 2 => "Tv-Priority",
+ 3 => "Av-Priority",
+ 4 => "Manual",
+ 5 => "A-DEP" ),
+
+28 => array( 'Name' => "Flash Activity",
+ 0 => "Flash Did Not Fire",
+ 1 => "Flash Fired" ),
+
+32 => array( 'Name' => "Focus Mode",
+ 0 => "Focus Mode: Single",
+ 1 => "Focus Mode: Continuous" )
+
+);
+
+/******************************************************************************
+* End of Global Variable: Canon_Camera_Settings_1_Tag_Values
+******************************************************************************/
+
+
+
+
+/******************************************************************************
+* Global Variable: Canon_Camera_Settings_2_Tag_Values
+*
+* Contents: This global variable provides definitions for the Canon Camera
+* Settings 2 Makernote tag, indexed by their offset.
+*
+******************************************************************************/
+
+$GLOBALS[ "Canon_Camera_Settings_2_Tag_Values" ] = array(
+
+7 => array ( 'Name' => "White Balance",
+ 0 => "Auto",
+ 1 => "Sunny",
+ 2 => "Cloudy",
+ 3 => "Tungsten",
+ 4 => "Flourescent",
+ 5 => "Flash",
+ 6 => "Custom" ),
+
+15 => array( 'Name' => "Flash Bias",
+ 0xffc0 => "-2 EV",
+ 0xffcc => "-1.67 EV",
+ 0xffd0 => "-1.5 EV",
+ 0xffd4 => "-1.33 EV",
+ 0xffe0 => "-1 EV",
+ 0xffec => "-0.67 EV",
+ 0xfff0 => "-0.5 EV",
+ 0xfff4 => "-0.33 EV",
+ 0x0000 => "0 EV",
+ 0x000c => "0.33 EV",
+ 0x0010 => "0.5 EV",
+ 0x0014 => "0.67 EV",
+ 0x0020 => "1 EV",
+ 0x002c => "1.33 EV",
+ 0x0030 => "1.5 EV",
+ 0x0034 => "1.67 EV",
+ 0x0040 => "2 EV" ),
+);
+
+/******************************************************************************
+* End of Global Variable: Canon_Camera_Settings_2_Tag_Values
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: Canon_Custom_Functions_Tag_Values
+*
+* Contents: This global variable provides definitions for the Canon Custom
+* Functions Makernote tag, indexed by their offset.
+*
+******************************************************************************/
+
+$GLOBALS[ "Canon_Custom_Functions_Tag_Values" ] = array(
+
+1 => array ( 'Name' => "Long Exposure Noise Reduction",
+ 0 => "Off",
+ 1 => "On" ),
+
+2 => array ( 'Name' => "Shutter/Auto Exposure-lock buttons",
+ 0 => "AF/AE lock",
+ 1 => "AE lock/AF",
+ 2 => "AF/AF lock",
+ 3 => "AE+release/AE+AF" ),
+
+3 => array ( 'Name' => "Mirror lockup",
+ 0 => "Disable",
+ 1 => "Enable" ),
+
+4 => array ( 'Name' => "Tv/Av and exposure level",
+ 0 => "1/2 stop",
+ 1 => "1/3 stop" ),
+
+5 => array ( 'Name' => "AF-assist light",
+ 0 => "On (Auto)",
+ 1 => "Off" ),
+
+6 => array ( 'Name' => "Shutter speed in Av mode",
+ 0 => "Automatic",
+ 1 => "1/200 (fixed)" ),
+
+7 => array ( 'Name' => "Auto-Exposure Bracketting sequence/auto cancellation",
+ 0 => "0,-,+ / Enabled",
+ 1 => "0,-,+ / Disabled",
+ 2 => "-,0,+ / Enabled",
+ 3 => "-,0,+ / Disabled" ),
+
+8 => array ( 'Name' => "Shutter Curtain Sync",
+ 0 => "1st Curtain Sync",
+ 1 => "2nd Curtain Sync" ),
+
+9 => array ( 'Name' => "Lens Auto-Focus stop button Function Switch",
+ 0 => "AF stop",
+ 1 => "Operate AF",
+ 2 => "Lock AE and start timer" ),
+
+10 => array ( 'Name' => "Auto reduction of fill flash",
+ 0 => "Enable",
+ 1 => "Disable" ),
+
+11 => array ( 'Name' => "Menu button return position",
+ 0 => "Top",
+ 1 => "Previous (volatile)",
+ 2 => "Previous" ),
+
+12 => array ( 'Name' => "SET button function when shooting",
+ 0 => "Not Assigned",
+ 1 => "Change Quality",
+ 2 => "Change ISO Speed",
+ 3 => "Select Parameters" ),
+
+13 => array ( 'Name' => "Sensor cleaning",
+ 0 => "Disable",
+ 1 => "Enable" )
+
+
+);
+
+/******************************************************************************
+* End of Global Variable: Canon_Custom_Functions_Tag_Values
+******************************************************************************/
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/casio.php b/includes/jpeg_metadata_tk/Makernotes/casio.php
new file mode 100644
index 0000000..d1cd74e
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/casio.php
@@ -0,0 +1,575 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: casio.php
+*
+* Description: Casio Makernote Parser
+* Provides functions to decode an Casio EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Casio Makernote Format:
+*
+* Type 1:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* IFD Data Variable Standard IFD Data using Casio Type 1 Tags and Motorola Byte Alignment
+* ----------------------------------------------------------------
+*
+* Type 2:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 6 Bytes "QVC\x00\x00\x00"
+* IFD Data Variable Standard IFD Data using Casio Type 2 Tags and Motorola Byte Alignment
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.11
+*
+* Changes: 1.00 -> 1.11 : changed get_Casio_Makernote_Html to allow thumbnail links to work when
+* toolkit is portable across directories
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Casio_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Casio_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Casio_Makernote_Html";
+
+include_once dirname(__FILE__) .'/../pjmt_utils.php'; // Change: as of version 1.11 - added to allow directory portability
+
+
+/******************************************************************************
+*
+* Function: get_Casio_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Casio_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ // Check if the Make Field contains the word Casio
+ if ( stristr( $Make_Field, "Casio" ) === FALSE )
+ {
+ return FALSE;
+ }
+
+
+ if ( substr( $Makernote_Tag['Data'],0 , 6 ) == "QVC\x00\x00\x00" )
+ {
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 6 );
+
+ $Makernote_Tag['ByteAlign'] = "MM";
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Casio Type 2" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Casio Type 2";
+ $Makernote_Tag['Makernote Tags'] = "Casio Type 2";
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+ else
+ {
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 0 );
+
+ $Makernote_Tag['ByteAlign'] = "MM";
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Casio Type 1" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Casio Type 1";
+ $Makernote_Tag['Makernote Tags'] = "Casio Type 1";
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+}
+
+/******************************************************************************
+* End of Function: get_Casio_Makernote
+******************************************************************************/
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Casio_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Casio_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Casio_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+
+ // Check that this tag uses the Casio tag definitions, otherwise it can't be decoded here
+ if ( $Tag_Definitions_Name == "Casio Type 2" )
+ {
+ // Tag Uses Casio Type 2 Tag definitions
+ // Process the tag according to it's tag number
+ if ( $Exif_Tag['Tag Number'] == 0x001D )
+ {
+ return $Exif_Tag['Data'][0]/10 . $Exif_Tag['Units'];
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ else if ( $Tag_Definitions_Name == "Casio Type 1" )
+ {
+ // Tag Uses Casio Type 1 Tags
+ return FALSE;
+ }
+ else
+ {
+ // Tag does NOT use Casio Tag definitions
+ return FALSE;
+ }
+
+ // Shouldn't get here
+ return FALSE;
+
+}
+
+/******************************************************************************
+* End of Function: get_Casio_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Casio_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Casio_Makernote_Html( $Makernote_tag, $filename )
+{
+ // Check that this tag uses the Casio tags, otherwise it can't be interpreted here
+ if ( ( $Makernote_tag['Makernote Type'] != "Casio Type 1" ) &&
+ ( $Makernote_tag['Makernote Type'] != "Casio Type 2" ) )
+ {
+ // Not Casio tags - can't interpret with this function
+ return FALSE;
+ }
+
+ // Casio Thumbnail (Tag 4)
+ if ( ( array_key_exists( 4, $Makernote_tag['Decoded Data'][0] ) ) &&
+ ( $Makernote_tag['Makernote Tags'] == "Casio Type 2" ) )
+ {
+ // Change: as of version 1.11 - Changed to make thumbnail link portable across directories
+ // Build the path of the thumbnail script and its filename parameter to put in a url
+ $link_str = get_relative_path( dirname(__FILE__) . "/get_casio_thumb.php" , getcwd ( ) );
+ $link_str .= "?filename=";
+ $link_str .= get_relative_path( $filename, dirname(__FILE__) );
+
+ // Add thumbnail link to html
+ $Makernote_tag['Decoded Data'][0][4]['Text Value'] = "<a class=\"EXIF_Casio_Thumb_Link\" href=\"$link_str\"><img class=\"EXIF_Casio_Thumb\" src=\"$link_str\"></a></td></tr>\n";
+ $Makernote_tag['Decoded Data'][0][4]['Type'] = "String";
+ }
+
+
+ // Casio Thumbnail (Tag 8192)
+ if ( ( array_key_exists( 8192, $Makernote_tag['Decoded Data'][0] ) ) &&
+ ( $Makernote_tag['Makernote Tags'] == "Casio Type 2" ) )
+ {
+ // Change: as of version 1.11 - Changed to make thumbnail link portable across directories
+ // Build the path of the thumbnail script and its filename parameter to put in a url
+ $link_str = get_relative_path( dirname(__FILE__) . "/.." . "/get_casio_thumb.php" , getcwd ( ) );
+ $link_str .= "?filename=";
+ $link_str .= get_relative_path( $filename, dirname(__FILE__) . "/.." );
+
+ // Add thumbnail link to html
+ $Makernote_tag['Decoded Data'][0][8192]['Text Value'] = "<a class=\"EXIF_Casio_Thumb_Link\" href=\"$link_str\"><img class=\"EXIF_Casio_Thumb\" src=\"$link_str\"></a></td></tr>\n";
+ $Makernote_tag['Decoded Data'][0][8192]['Type'] = "String";
+ }
+
+
+ // Check if there are two thumbnail offset tags
+ if ( ( array_key_exists( 4, $Makernote_tag['Decoded Data'][0] ) ) &&
+ ( array_key_exists( 8192, $Makernote_tag['Decoded Data'][0] ) ) )
+ {
+ // There are two copies of the thumbnail offset - Remove one
+ array_splice( $Makernote_tag['Decoded Data'][0], 4, 1);
+ }
+
+
+ // Interpret the IFD and return the html
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Casio_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Casio Type 1
+*
+* Contents: This global variable provides definitions of the known Casio Type 1
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Casio Type 1"] = array(
+
+1 => array( 'Name' => "Recording Mode",
+ 'Type' => "Lookup",
+ 1 => "Single Shutter",
+ 2 => "Panorama",
+ 3 => "Night Scene",
+ 4 => "Portrait",
+ 5 => "Landscape" ),
+
+2 => array( 'Name' => "Quality",
+ 'Type' => "Lookup",
+ 1 => "Economy",
+ 2 => "Normal",
+ 3 => "Fine" ),
+
+3 => array( 'Name' => "Focusing Mode",
+ 'Type' => "Lookup",
+ 2 => "Macro",
+ 3 => "Auto Focus",
+ 4 => "Manual Focus",
+ 5 => "Infinity" ),
+
+4 => array( 'Name' => "Flash Mode",
+ 'Type' => "Lookup",
+ 1 => "Auto",
+ 2 => "On",
+ 3 => "Off",
+ 4 => "Off" ),
+
+5 => array( 'Name' => "Flash Intensity",
+ 'Type' => "Lookup",
+ 11 => "Weak",
+ 13 => "Normal",
+ 15 => "Strong" ),
+
+6 => array( 'Name' => "Object Distance",
+ 'Type' => "Numeric",
+ 'Units' => "mm" ),
+
+7 => array( 'Name' => "White Balance",
+ 'Type' => "Lookup",
+ 1 => "Auto",
+ 2 => "Tungsten",
+ 3 => "Daylight",
+ 4 => "Flourescent",
+ 5 => "Shade",
+ 129 => "Manual" ),
+
+10 => array( 'Name' => "Digital Zoom",
+ 'Type' => "Lookup",
+ 0x10000 => "Off",
+ 0x10001 => "2x Digital Zoom",
+ 0x20000 => "2x Digital Zoom",
+ 0x40000 => "4x Digital Zoom" ),
+
+11 => array( 'Name' => "Sharpness",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Soft",
+ 2 => "Hard" ),
+
+12 => array( 'Name' => "Contrast",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Low",
+ 2 => "High" ),
+
+13 => array( 'Name' => "Saturation",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Low",
+ 2 => "High" ),
+
+20 => array( 'Name' => "CCD Sensitivity",
+ 'Type' => "Lookup",
+ 64 => "Normal",
+ 125 => "+1.0",
+ 250 => "+2.0",
+ 244 => "+3.0",
+ 80 => "Normal (ISO 80 equivalent)",
+ 100 => "High" ),
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Casio Type 1
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Casio Type 2
+*
+* Contents: This global variable provides definitions of the known Casio Type 2
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Casio Type 2"] = array(
+
+0x0002 => array( 'Name' => "Preview Thumbnail Dimensions",
+ 'Type' => "Numeric",
+ 'Units' => "(x,y pixels)" ),
+
+0x0003 => array( 'Name' => "Preview Thumbnail Size",
+ 'Type' => "Numeric",
+ 'Units' => "bytes" ),
+
+0x0004 => array( 'Name' => "Preview Thumbnail", // thumbnail offset
+ 'Type' => "Numeric" ),
+
+
+0x0008 => array( 'Name' => "Quality Mode",
+ 'Type' => "Lookup",
+ 1 => "Fine",
+ 2 => "Super Fine" ),
+
+0x0009 => array( 'Name' => "Image Size",
+ 'Type' => "Lookup",
+ 20 => "2288 x 1712 pixels",
+ 36 => "3008 x 2008 pixels",
+ 5 => "2048 x 1536 pixels",
+ 4 => "1600 x 1200 pixels",
+ 21 => "2592 x 1944 pixels",
+ 0 => "640 x 480 pixels",
+ 22 => "2304 x 1728 pixels" ),
+
+0x000D => array( 'Name' => "Focus Mode",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Macro" ),
+
+
+0x0014 => array( 'Name' => "Iso Sensitivity",
+ 'Type' => "Lookup",
+ 3 => "50",
+ 4 => "64",
+ 6 => "100",
+ 9 => "200" ),
+
+
+0x0019 => array( 'Name' => "White Balance",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "Daylight",
+ 2 => "Shade",
+ 3 => "Tungsten",
+ 4 => "Fluorescent",
+ 5 => "Manual" ),
+
+0x001D => array( 'Name' => "Focal Length",
+ 'Type' => "Special",
+ 'Units' => "mm" ),
+
+0x001F => array( 'Name' => "Saturation",
+ 'Type' => "Lookup",
+ 0 => "-1",
+ 1 => "Normal",
+ 2 => "+1", ),
+
+0x0020 => array( 'Name' => "Contrast",
+ 'Type' => "Lookup",
+ 0 => "-1",
+ 1 => "Normal",
+ 2 => "+1", ),
+
+0x0021 => array( 'Name' => "Sharpness",
+ 'Type' => "Lookup",
+ 0 => "-1",
+ 1 => "Normal",
+ 2 => "+1", ),
+
+
+0x0e00 => array( 'Name' => "Print Image Matching Info",
+ 'Type' => "PIM" ),
+
+
+0x2000 => array( 'Name' => "Casio Preview Thumbnail", // thumbnail offset
+ 'Type' => "String" ),
+
+
+
+0x2011 => array( 'Name' => "White Balance Bias",
+ 'Type' => "Numeric" ),
+
+
+0x2012 => array( 'Name' => "White Balance",
+ 'Type' => "Lookup",
+ 12 => "Flash",
+ 0 => "Manual",
+ 1 => "Auto?",
+ 4 => "Flash?", ),
+
+0x2022 => array( 'Name' => "Object Distance",
+ 'Type' => "Numeric",
+ 'Units' => "mm" ),
+
+
+0x2034 => array( 'Name' => "Flash Distance",
+ 'Type' => "Numeric",
+ 'Units' => " (0=Off)" ),
+
+0x3000 => array( 'Name' => "Record Mode",
+ 'Type' => "Lookup",
+ 2 => "Normal Mode" ),
+
+0x3001 => array( 'Name' => "Self Timer?",
+ 'Type' => "Lookup",
+ 1 => "Off?" ),
+
+
+0x3002 => array( 'Name' => "Quality",
+ 'Type' => "Lookup",
+ 3 => "Fine" ),
+
+0x3003 => array( 'Name' => "Focus Mode",
+ 'Type' => "Lookup",
+ 6 => "Multi-Area Auto Focus",
+ 1 => "Fixation" ),
+
+
+0x3006 => array( 'Name' => "Time Zone",
+ 'Type' => "String" ),
+
+
+0x3007 => array( 'Name' => "Bestshot Mode",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "On?" ),
+
+
+0x3014 => array( 'Name' => "CCD ISO Sensitivity",
+ 'Type' => "Numeric" ),
+
+
+
+0x3015 => array( 'Name' => "Colour Mode",
+ 'Type' => "Lookup",
+ 0 => "Off" ),
+
+
+0x3016 => array( 'Name' => "Enhancement",
+ 'Type' => "Lookup",
+ 0 => "Off" ),
+
+0x3017 => array( 'Name' => "Filter",
+ 'Type' => "Lookup",
+ 0 => "Off" ),
+
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Casio Type 2
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+?> \ No newline at end of file
diff --git a/includes/jpeg_metadata_tk/Makernotes/epson.php b/includes/jpeg_metadata_tk/Makernotes/epson.php
new file mode 100644
index 0000000..16057bb
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/epson.php
@@ -0,0 +1,119 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: epson.php
+*
+* Description: Epson Makernote Parser
+* Provides functions to decode an Epson EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Epson Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 8 Bytes "EPSON\x00\x01\x00"
+* IFD Data Variable Standard IFD Data using Olympus Tags
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+// Epson makernote uses Olympus tags - ensure they are included
+
+include_once 'olympus.php';
+
+
+
+
+// Add the Parser function to the list of Makernote Parsers. (Interpreter Functions are supplied by the Olympus script)
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Epson_Makernote";
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Epson_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Epson_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ // Check if the Make Field contains the word Epson
+ if ( stristr( $Make_Field, "Epson" ) === FALSE )
+ {
+ return FALSE;
+ }
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'], 0, 8 ) != "EPSON\x00\x01\x00" )
+ {
+ // This isn't a Epson Makernote, abort
+ return FALSE ;
+ }
+
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 8 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Olympus" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Epson";
+ $Makernote_Tag['Makernote Tags'] = "Olympus";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+
+}
+
+/******************************************************************************
+* End of Function: get_Epson_Makernote
+******************************************************************************/
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/fujifilm.php b/includes/jpeg_metadata_tk/Makernotes/fujifilm.php
new file mode 100644
index 0000000..5d135cd
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/fujifilm.php
@@ -0,0 +1,344 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: fujifilm.php
+*
+* Description: Fujifilm Makernote Parser
+* Provides functions to decode an Fujifilm EXIF makernote and to interpret
+* the resulting array into html.
+* This Makernote format is also used by one Nikon Camera
+*
+* Fujifilm Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 8 Bytes "FUJIFILM"
+* IFD Offset 4 Bytes Intel Byte aligned offset to IFD from start of Makernote
+* IFD Data Variable NON-Standard IFD Data using Fujifilm Tags
+* Offsets are relative to start of makernote
+* Byte alignment is always Intel
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Fujifilm_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Fujifilm_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Fujifilm_Makernote_Html";
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Fujifilm_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Fujifilm_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ // Check if the Make Field contains the word Fuji or Nikon (One Nikon camera uses this format Makernote)
+ if ( ( stristr( $Make_Field, "Fuji" ) === FALSE ) &&
+ ( stristr( $Make_Field, "Nikon" ) === FALSE ) )
+ {
+ // Couldn't find Fuji or Nikon in the maker name - abort
+ return FALSE;
+ }
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'], 0, 8 ) != "FUJIFILM" )
+ {
+ // This isn't a Fuji Makernote, abort
+ return FALSE;
+ }
+
+ // The 4 bytes after the header are the offset to the Fujifilm IFD
+ // Get the offset of the IFD
+ $ifd_offset = hexdec( bin2hex( strrev( substr( $Makernote_Tag['Data'], 8, 4 ) ) ) );
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + $ifd_offset );
+
+ // Fuji Makernotes are always Intel Byte Aligned
+ $Makernote_Tag['ByteAlign'] = "II";
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'], $Makernote_Tag['ByteAlign'], "Fujifilm" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Fujifilm";
+ $Makernote_Tag['Makernote Tags'] = "Fujifilm";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+
+}
+
+/******************************************************************************
+* End of Function: get_Fujifilm_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Fujifilm_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Fujifilm_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Fujifilm_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+ // Check that this tag uses the Fujifilm tag Definitions, otherwise it can't be decoded here
+ if ( $Tag_Definitions_Name == "Fujifilm" )
+ {
+ // No special Tags at this time
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Fujifilm_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Fujifilm_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Fujifilm_Makernote_Html( $Makernote_tag, $filename )
+{
+ // Check that this tag uses the Fujifilm tags, otherwise it can't be interpreted here
+ if ( $Makernote_tag['Makernote Type'] != "Fujifilm" )
+ {
+ // Not Fujifilm tags - can't interpret with this function
+ return FALSE;
+ }
+
+ // Interpret the IFD normally
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Fujifilm_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Fujifilm
+*
+* Contents: This global variable provides definitions of the known Fujifilm
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Fujifilm"] = array(
+
+0 => array( 'Name' => "Version",
+ 'Type' => "String" ),
+
+4096 => array( 'Name' => "Quality",
+ 'Type' => "String" ),
+
+4097 => array( 'Name' => "Sharpness",
+ 'Type' => "Lookup",
+ 1 => "Softest",
+ 2 => "Soft",
+ 3 => "Normal",
+ 4 => "Hard",
+ 5 => "Hardest" ),
+
+4098 => array( 'Name' => "White Balance",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 256 => "Daylight",
+ 512 => "Cloudy",
+ 768 => "DaylightColour-fluorescence",
+ 769 => "DaywhiteColour-fluorescence",
+ 770 => "White-fluorescence",
+ 1024 => "Incandenscense",
+ 3840 => "Custom white balance" ),
+
+4099 => array( 'Name' => "Colour Saturation",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 256 => "High",
+ 512 => "Low" ),
+
+4100 => array( 'Name' => "Tone (Contrast)",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 256 => "High",
+ 512 => "Low" ),
+
+4112 => array( 'Name' => "Flash Mode",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "On",
+ 2 => "Off",
+ 3 => "Red-eye Reduction" ),
+
+4113 => array( 'Name' => "Flash Strength",
+ 'Type' => "Numeric",
+ 'Units' => "EV" ),
+
+4128 => array( 'Name' => "Macro",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "On" ),
+
+4129 => array( 'Name' => "Focus Mode",
+ 'Type' => "Lookup",
+ 0 => "Auto Focus",
+ 1 => "Manual Focus" ),
+
+4144 => array( 'Name' => "Slow Sync",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "On" ),
+
+4145 => array( 'Name' => "Picture Mode",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "Portrait Scene",
+ 2 => "Landscape Scene",
+ 4 => "Sports Scene",
+ 5 => "Night Scene",
+ 6 => "Program AE",
+ 256 => "Aperture priority AE",
+ 512 => "Shutter priority AE",
+ 768 => "Manual Exposure" ),
+
+4352 => array( 'Name' => "Continuous taking or auto bracketing mode",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "On" ),
+
+4864 => array( 'Name' => "Blur Warning",
+ 'Type' => "Lookup",
+ 0 => "No Blur Warning",
+ 1 => "Blur Warning" ),
+
+4865 => array( 'Name' => "Focus warning",
+ 'Type' => "Lookup",
+ 0 => "Auto Focus Good",
+ 1 => "Out of Focus" ),
+
+4866 => array( 'Name' => "Auto Exposure Warning",
+ 'Type' => "Lookup",
+ 0 => "Auto Exposure Good",
+ 1 => "Over exposure (>1/1000s,F11)" )
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Fujifilm
+******************************************************************************/
+
+
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/konica_minolta.php b/includes/jpeg_metadata_tk/Makernotes/konica_minolta.php
new file mode 100644
index 0000000..17bbfbd
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/konica_minolta.php
@@ -0,0 +1,745 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: konica_minolta.php
+*
+* Description: Konica/Minolta Makernote Parser
+* Provides functions to decode an Konica/Minolta EXIF makernote and
+* to interpret the resulting array into html.
+*
+* Konica/Minolta Makernote Formats:
+*
+* Type 1:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 3 Bytes "MLY"
+* Unknown Data Variable Unknown Data
+* ----------------------------------------------------------------
+*
+* Type 2:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 2 Bytes "KC"
+* Unknown Data Variable Unknown Data
+* ----------------------------------------------------------------
+*
+* Type 3:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 8 Bytes "+M+M+M+M"
+* Unknown Data Variable Unknown Data
+* ----------------------------------------------------------------
+*
+* Type 4:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 5 Bytes "MINOL"
+* Unknown Data Variable Unknown Data
+* ----------------------------------------------------------------
+*
+* Type 5: NO HEADER
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* IFD Data Variable Standard IFD with Olympus Tags
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+// Konica/Minolta makernote uses Olympus tags - ensure they are included
+
+include_once 'olympus.php';
+
+
+// Add the parser functions to the list of Makernote parsers . (Interpreting done by Olympus script)
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Minolta_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Minolta_Text_Value";
+
+
+
+/******************************************************************************
+*
+* Function: get_Minolta_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Minolta_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ if ( ( stristr( $Make_Field, "Konica" ) === FALSE ) &&
+ ( stristr( $Make_Field, "Minolta" ) === FALSE ) )
+ {
+ // Not a Konica/Minolta Makernote - Cannot decode it
+ return False;
+ }
+
+ // There are several different headers for a Konica/Minolta Makernote
+ // Unfortunately only one type can be decoded (the one without a header)
+ // Check which header exists (if any)
+ if ( substr( $Makernote_Tag['Data'], 0, 3 ) == "MLY" )
+ {
+ // MLY Header - Can't Decode this
+ return $Makernote_Tag;
+ }
+ else if ( substr( $Makernote_Tag['Data'], 0, 2 ) == "KC" )
+ {
+ // KC Header - Can't Decode this
+ return $Makernote_Tag;
+ }
+ if ( substr( $Makernote_Tag['Data'], 0, 8 ) == "+M+M+M+M" )
+ {
+ // +M+M+M+M Header - Can't Decode this
+ return $Makernote_Tag;
+ }
+ else if ( substr( $Makernote_Tag['Data'], 0, 5 ) == "MINOL" )
+ {
+ // MINOL Header - Can't Decode this
+ return $Makernote_Tag;
+ }
+ else
+ {
+ // No Header - Decode the IFD
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Olympus" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Minolta";
+ $Makernote_Tag['Makernote Tags'] = "Olympus";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+
+ }
+
+
+ // Shouldn't get here
+ return False;
+}
+
+/******************************************************************************
+* End of Function: get_Minolta_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Minolta_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Olympus_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Minolta_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+ // Check that this Tag uses Olympus type tags - otherwise it cannot be processed here
+ if ( $Tag_Definitions_Name !== "Olympus" )
+ {
+ // Not Olympus Tags - cannot be processed here
+ return FALSE;
+ }
+
+
+ // Process the tag acording to it's tag number, to produce a text value
+
+ if ( ( $Exif_Tag['Tag Number'] == 0x0001 ) || // Minolta Camera Settings
+ ( $Exif_Tag['Tag Number'] == 0x0003 ) )
+ {
+
+ // Create the output string
+ $output_str = "";
+
+ // Cycle through each camera setting record which are 4 byte Longs
+
+ for ( $i = 1; $i*4 <= strlen( $Exif_Tag['Data'] ); $i++)
+ {
+
+ // Exract the current 4 byte Long value (Motorola byte alignment)
+ $value = get_IFD_Data_Type( substr($Exif_Tag['Data'], ($i-1)*4, 4) , 4, "MM" );
+
+ // Corrupt settings can cause huge values, which automatically get
+ // put into floating point variables instead of integer variables
+ // Hence Check that this is an integer, as problems will occur if it isn't
+ if ( is_integer( $value ) )
+ {
+
+ // Check if the current setting number is in the Definitions array
+ if ( array_key_exists( $i, ($GLOBALS[ "Minolta_Camera_Setting_Definitions" ]) ) === TRUE )
+ {
+ // Setting is in definitions array
+
+ // Get some of the information from the settings definitions array
+ $tagname = $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ][ 'Name' ];
+ $units = "";
+ if ( array_key_exists( 'Units', $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ] ) )
+ {
+ $units = $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ][ 'Units' ];
+ }
+ // Check what type of field the setting is, and process accordingly
+
+ if ( $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ]['Type'] == "Lookup" )
+ {
+ // This is a lookup table field
+
+ // Check if the value read is in the lookup table
+ if ( array_key_exists( $value, $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ] ) )
+ {
+ // Value is in the lookup table - Add it to the text
+ $output_str .= $tagname . ": " . $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ][ $value ] . "\n";
+ }
+ else
+ {
+ // Value is Not in the lookup table
+ // Add a message if the user has requested to see unknown tags
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= $tagname . ": Unknown Reserved Value $value\n";
+ }
+
+ }
+ }
+ else if ( $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ]['Type'] == "Numeric" )
+ {
+ // This is a numeric type add it as is to the output, with units
+ $output_str .= $tagname . ": $value $units\n";
+ }
+ else if ( $GLOBALS[ "Minolta_Camera_Setting_Definitions" ][ $i ]['Type'] == "Special" )
+ {
+ // This is a special setting, Process it according to the setting number
+ switch ( $i )
+ {
+ case 9: // Apex Film Speed Value
+ $output_str .= $tagname . ": " . ($value/8-1) . " ( ISO " . ((pow(2,($value/8-1)))*3.125) . " )\n";
+ break;
+
+ case 10: // Apex Shutter Speed Time Value
+ $output_str .= $tagname . ": " . ($value/8-6);
+ if ( $value == 8 )
+ {
+ $output_str .= " ( 30 seconds )\n";
+ }
+ else
+ {
+ $output_str .= " ( " . ( pow(2, (48-$value)/8 ) ) . " seconds )\n";
+ }
+ break;
+
+ case 11: // Apex Aperture Value
+ $output_str .= $tagname . ": " . ($value/8-1) . " ( F Stop: " . (pow(2,( $value/16-0.5 ))) . " )\n";
+ break;
+
+ case 14: // Exposure Compensation
+ $output_str .= $tagname . ": " . ($value/3-2) . " $units\n";
+ break;
+
+ case 17: // Interval Length
+ $output_str .= $tagname . ": " . ($value+1) . " $units\n";
+ break;
+
+ case 19: // Focal Length
+ $output_str .= $tagname . ": " . ($value/256) . " $units\n";
+ break;
+
+ case 22: // Date
+ $output_str .= $tagname . ": " . sprintf( "%d/%d/%d", ($value%256), floor(($value - floor($value/65536)*65536)/256 ), floor($value/65536) ) . " $units\n";
+ break;
+
+ case 23: // Time
+ $output_str .= $tagname . ": " . sprintf( "%2d:%02d:%02d", floor($value/65536), floor(($value - floor($value/65536)*65536)/256 ), ($value%256) ) . " $units\n";
+ break;
+
+ case 24: // Max Aperture at this focal length
+ $output_str .= $tagname . ": F" . (pow(2,($value/16-0.5))) ." $units\n";
+ break;
+
+ case 29: // White Balance Red
+ case 30: // White Balance Green
+ case 31: // White Balance Blue
+ $output_str .= $tagname . ": " . ($value/256) ." $units\n";
+ break;
+
+ case 32: // Saturation
+ case 33: // Contrast
+ $output_str .= $tagname . ": " . ($value-3) ." $units\n";
+ break;
+
+ case 36: // Flash Compensation
+ $output_str .= $tagname . ": " . (($value-6)/3) ." $units\n";
+ break;
+
+ case 42: // Color Filter
+ $output_str .= $tagname . ": " . ($value-3) ." $units\n";
+ break;
+
+ case 45: // Apex Brightness Value
+ $output_str .= $tagname . ": " . ($value/8-6) ." $units\n";
+ break;
+
+ default: // Unknown Special Setting
+ // If user has requested to see the unknown tags, then add the setting to the output
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= "Unknown Special Tag: $tagname, Value: $value $units\n";
+ }
+ break;
+ }
+ }
+ else
+ {
+ // Unknown Setting Type
+ // If user has requested to see the unknown tags, then add the setting to the output
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= "Unknown Tag Type Tag $i, Value: " . $value . "\n";
+ }
+ }
+
+
+ }
+ else
+ {
+ // Unknown Setting
+ // If user has requested to see the unknown tags, then add the setting to the output
+ if ( $GLOBALS['HIDE_UNKNOWN_TAGS'] == FALSE )
+ {
+ $output_str .= "Unknown Minolta Camera Setting Tag $i, Value: " . $value . "\n";
+ }
+ }
+ }
+
+ }
+
+ // Return the text string
+ return $output_str;
+ }
+ else if ( ( $Exif_Tag['Tag Number'] == 0x0088 ) ||
+ ( $Exif_Tag['Tag Number'] == 0x0081 ) )
+ {
+ // Konica/Minolta Thumbnail
+ return "Thumbnail";
+ }
+ else
+ {
+ return FALSE;
+ }
+
+}
+
+/******************************************************************************
+* End of Function: get_Minolta_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: Minolta_Camera_Setting_Definitions
+*
+* Contents: This global variable provides definitions for the fields
+* contained in the Konica/Minolta Camera Settings Makernote tag,
+* indexed by their setting number.
+*
+******************************************************************************/
+
+$GLOBALS[ "Minolta_Camera_Setting_Definitions" ] = array(
+
+2 => array ( 'Name' => "Exposure Mode",
+ 'Type' => "Lookup",
+ 0 => "P",
+ 1 => "A",
+ 2 => "S",
+ 3 => "M" ),
+
+3 => array ( 'Name' => "Flash Mode",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Red-eye reduction",
+ 2 => "Rear flash sync",
+ 3 => "Wireless" ),
+
+4 => array ( 'Name' => "White Balance",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "Daylight",
+ 2 => "Cloudy",
+ 3 => "Tungsten",
+ 5 => "Custom",
+ 7 => "Fluorescent",
+ 8 => "Fluorescent 2",
+ 11 => "Custom 2",
+ 12 => "Custom 3" ),
+
+5 => array ( 'Name' => "Image Size",
+ 'Type' => "Lookup",
+ 0 => "2560 x 1920 (2048x1536 - DiMAGE 5 only)",
+ 1 => "1600 x 1200",
+ 2 => "1280 x 960",
+ 3 => "640 x 480" ),
+
+
+6 => array ( 'Name' => "Image Quality",
+ 'Type' => "Lookup",
+ 0 => "Raw",
+ 1 => "Super Fine",
+ 2 => "Fine",
+ 3 => "Standard",
+ 4 => "Economy",
+ 5 => "Extra Fine" ),
+
+7 => array ( 'Name' => "Shooting Mode",
+ 'Type' => "Lookup",
+ 0 => "Single",
+ 1 => "Continuous",
+ 2 => "Self-timer",
+ 4 => "Bracketing",
+ 5 => "Interval",
+ 6 => "UHS Continuous",
+ 7 => "HS Continuous" ),
+
+
+8 => array ( 'Name' => "Metering Mode",
+ 'Type' => "Lookup",
+ 0 => "Multi-Segment",
+ 1 => "Centre Weighted",
+ 2 => "Spot" ),
+
+
+9 => array ( 'Name' => "Apex Film Speed Value",
+ 'Type' => "Special" ),
+
+// 09 FilmSpeed , APEX Film Speed Value , Speed value = x/8-1 , ISO= (2^(x/8-1))*3.125
+
+
+10 => array ( 'Name' => "Apex Shutter Speed Time Value",
+ 'Type' => "Special",
+ 'Units' => "Seconds?" ),
+
+// APEX Time Value , Time value = x/8-6 , ShutterSpeed = 2^( (48-x)/8 ), ! Due to rounding error x=8 should be displayed as 30 sec.
+
+11 => array ( 'Name' => "Apex Aperture Value",
+ 'Type' => "Special" ),
+
+// APEX Aperture Value ApertureValue = x/8-1 , Aperture = 2^( x/16-0.5 )
+
+
+12 => array ( 'Name' => "Macro Mode",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "On" ),
+
+13 => array ( 'Name' => "Digital Zoom",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "Electronic magnification was used",
+ 2 => "Digital zoom 2x" ),
+
+
+14 => array ( 'Name' => "Exposure Compensation",
+ 'Type' => "Special",
+ 'Units' => "EV" ),
+
+// EV = x/3 -2 Exposure compensation in EV
+
+
+15 => array ( 'Name' => "Bracket Step",
+ 'Type' => "Lookup",
+ 0 => "1/3 EV",
+ 1 => "2/3 EV",
+ 2 => "1 EV" ),
+
+
+17 => array ( 'Name' => "Interval Length",
+ 'Type' => "Special",
+ 'Units' => "Min" ),
+
+// interval is x+1 min (used with interval mode)
+
+
+18 => array ( 'Name' => "Interval Number",
+ 'Type' => "Numeric",
+ 'Units' => "frames" ),
+
+19 => array ( 'Name' => "Focal Length",
+ 'Type' => "Special",
+ 'Units' => "mm" ),
+
+// x / 256 is real focal length in mm , x / 256 * 3.9333 is 35-mm equivalent
+
+
+20 => array ( 'Name' => "Focus Distance",
+ 'Type' => "Numeric",
+ 'Units' => "mm ( 0 = Infinity)" ),
+
+
+21 => array ( 'Name' => "Flash Fired",
+ 'Type' => "Lookup",
+ 0 => "No",
+ 1 => "Yes" ),
+
+22 => array ( 'Name' => "Date",
+ 'Type' => "Special" ),
+
+// yyyymmdd , year = x/65536 , month = x/256-x/65536*256 , day = x%256
+
+23 => array ( 'Name' => "Time",
+ 'Type' => "Special" ),
+
+// hhhhmmss , hour = x/65536 , minute = x/256-x/65536*256 , second = x%256
+
+
+24 => array ( 'Name' => "Max Aperture at this focal length",
+ 'Type' => "Special" ),
+
+// Fno = 2^(x/16-0.5)
+
+
+27 => array ( 'Name' => "File Number Memory",
+ 'Type' => "Lookup",
+ 0 => "Off",
+ 1 => "On" ),
+
+28 => array ( 'Name' => "Last File Number",
+ 'Type' => "Numeric",
+ 'Units' => " ( 0 = File Number Memory is Off)" ),
+
+
+29 => array ( 'Name' => "White Balance Red",
+ 'Type' => "Special" ),
+
+// x/256 - red white balance coefficient used for this picture
+
+
+30 => array ( 'Name' => "White Balance Green",
+ 'Type' => "Special" ),
+
+// x/256 - green white balance coefficient used for this picture
+
+31 => array ( 'Name' => "White Balance Blue",
+ 'Type' => "Special" ),
+
+// x/256 - blue white balance coefficient used for this picture
+
+
+32 => array ( 'Name' => "Saturation",
+ 'Type' => "Special" ),
+
+// x-3 = saturation
+
+
+33 => array ( 'Name' => "Contrast",
+ 'Type' => "Special" ),
+
+// x-3 - contrast
+
+
+34 => array ( 'Name' => "Sharpness",
+ 'Type' => "Lookup",
+ 0 => "Hard",
+ 1 => "Normal",
+ 2 => "Soft" ),
+
+
+35 => array ( 'Name' => "Subject Program",
+ 'Type' => "Lookup",
+ 0 => "none",
+ 1 => "portrait",
+ 2 => "text",
+ 3 => "night portrait",
+ 4 => "sunset",
+ 5 => "sports action" ),
+
+
+36 => array ( 'Name' => "Flash Compensation",
+ 'Type' => "Special",
+ 'Units' => "EV" ),
+
+// (x-6)/3 = flash compensation in EV
+
+
+37 => array ( 'Name' => "ISO Setting",
+ 'Type' => "Lookup",
+ 0 => "100",
+ 1 => "200",
+ 2 => "400",
+ 3 => "800",
+ 4 => "auto",
+ 5 => "64" ),
+
+
+38 => array ( 'Name' => "Camera Model",
+ 'Type' => "Lookup",
+ 0 => "DiMAGE 7",
+ 1 => "DiMAGE 5",
+ 2 => "DiMAGE S304",
+ 3 => "DiMAGE S404",
+ 4 => "DiMAGE 7i",
+ 5 => "DiMAGE 7Hi",
+ 6 => "DiMAGE A1",
+ 7 => "DiMAGE S414" ),
+
+
+39 => array ( 'Name' => "Interval Mode",
+ 'Type' => "Lookup",
+ 0 => "Still Image",
+ 1 => "Time-lapse Movie" ),
+
+
+40 => array ( 'Name' => "Folder Name",
+ 'Type' => "Lookup",
+ 0 => "Standard Form",
+ 1 => "Data Form" ),
+
+
+41 => array ( 'Name' => "Color Mode",
+ 'Type' => "Lookup",
+ 0 => "Natural Color",
+ 1 => "Black & White",
+ 2 => "Vivid Color",
+ 3 => "Solarization",
+ 4 => "Adobe RGB" ),
+
+
+42 => array ( 'Name' => "Color Filter",
+ 'Type' => "Special" ),
+
+// x-3 = color filter
+
+
+43 => array ( 'Name' => "Black & White Filter",
+ 'Type' => "Numeric" ),
+
+
+
+44 => array ( 'Name' => "Internal Flash",
+ 'Type' => "Lookup",
+ 0 => "Not Fired",
+ 1 => "Fired" ),
+
+
+
+45 => array ( 'Name' => "Apex Brightness Value",
+ 'Type' => "Special" ),
+
+// Brightness Value = x/8-6
+
+
+
+
+46 => array ( 'Name' => "Spot Focus Point X Coordinate",
+ 'Type' => "Numeric" ),
+
+
+
+47 => array ( 'Name' => "Spot Focus Point Y Coordinate",
+ 'Type' => "Numeric" ),
+
+
+
+48 => array ( 'Name' => "Wide Focus Zone",
+ 'Type' => "Lookup",
+ 0 => "No Zone or AF Failed",
+ 1 => "Center Zone (Horizontal Orientation)",
+ 2 => "Center Zone (Vertical Orientation)",
+ 3 => "Left Zone",
+ 4 => "Right Zone" ),
+
+
+49 => array ( 'Name' => "Focus Mode",
+ 'Type' => "Lookup",
+ 0 => "Auto Focus",
+ 1 => "Manual Focus" ),
+
+
+50 => array ( 'Name' => "Focus Area",
+ 'Type' => "Lookup",
+ 0 => "Wide Focus (normal)",
+ 1 => "Spot Focus" ),
+
+
+51 => array ( 'Name' => "DEC Switch Position",
+ 'Type' => "Lookup",
+ 0 => "Exposure",
+ 1 => "Contrast",
+ 2 => "Saturation",
+ 3 => "Filter" ),
+
+
+
+);
+
+/******************************************************************************
+* End of Global Variable: Minolta_Camera_Setting_Definitions
+******************************************************************************/
+
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/kyocera.php b/includes/jpeg_metadata_tk/Makernotes/kyocera.php
new file mode 100644
index 0000000..bb5f17e
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/kyocera.php
@@ -0,0 +1,241 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: kyocera.php
+*
+* Description: Kyocera Makernote Parser
+* Provides functions to decode an Kyocera EXIF makernote and to interpret
+* the resulting array into html. Includes Kyocera's Contax brand
+*
+* Kyocera Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 22 Bytes "KYOCERA \x00\x00\x00"
+* IFD Data Variable NON-Standard IFD Data using Kyocera Tags
+* IFD has no Next-IFD pointer at end of IFD,
+* and Offsets are relative to the start
+* of the current IFD tag, not the TIFF header
+* ----------------------------------------------------------------
+*
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Kyocera_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Kyocera_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Kyocera_Makernote_Html";
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Kyocera_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Kyocera_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ // Check if the Make Field contains the word Contax or Kyocera
+ if ( ( stristr( $Make_Field, "Contax" ) === FALSE ) &&
+ ( stristr( $Make_Field, "Kyocera" ) === FALSE ) )
+ {
+ // Kyocera or Contax not found in maker field - abort
+ return FALSE;
+ }
+
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'], 0, 22 ) != "KYOCERA \x00\x00\x00" )
+ {
+ // This isn't a Kyocera Makernote, abort
+ return FALSE ;
+ }
+
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 22 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Kyocera", True, False );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Kyocera";
+ $Makernote_Tag['Makernote Tags'] = "Kyocera";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+}
+
+/******************************************************************************
+* End of Function: get_Kyocera_Makernote
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Kyocera_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Kyocera_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Kyocera_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+ // Check that this tag uses Kyocera tags, otherwise it can't be interpreted here
+ if ( $Tag_Definitions_Name == "Kyocera" )
+ {
+ // No Special Kyocera tags so far
+ return FALSE;
+ }
+
+ return FALSE;
+
+}
+
+/******************************************************************************
+* End of Function: get_Kyocera_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Kyocera_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Kyocera_Makernote_Html( $Makernote_tag, $filename )
+{
+
+ // Check that this is a Kyocera Makernote, otherwise it can't be interpreted here
+ if ( $Makernote_tag['Makernote Type'] != "Kyocera" )
+ {
+ // Not a Kyocera Makernote - cannot interpret it - abort
+ return False;
+ }
+
+ // Interpret the IFD and return the HTML
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Kyocera_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Kyocera
+*
+* Contents: This global variable provides definitions of the known Kyocera
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Kyocera"] = array(
+
+1 => array( 'Name' => "Kyocera Proprietory Format Thumbnail",
+ 'Type' => "Unknown" ),
+
+0x0E00 => array( 'Name' => "Print Image Matching Info",
+ 'Type' => "PIM" ),
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Kyocera
+******************************************************************************/
+
+
+
+
+
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/nikon.php b/includes/jpeg_metadata_tk/Makernotes/nikon.php
new file mode 100644
index 0000000..b860d51
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/nikon.php
@@ -0,0 +1,731 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: Nikon.php
+*
+* Description: Nikon Makernote Parser
+* Provides functions to decode an Nikon EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Nikon Makernote Format:
+*
+* Type 1
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 8 Bytes "Nikon\x00\x01\x00"
+* IFD Data Variable Standard IFD Data using Nikon Type 1 Tags
+* ----------------------------------------------------------------
+*
+* Type 2
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* IFD Data Variable Standard IFD Data using Nikon Type 3 Tags
+* ----------------------------------------------------------------
+*
+* Type 3
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 10 Bytes "Nikon\x00\x02\x10\x00\x00"
+* or
+* "Nikon\x00\x02\x00\x00\x00"
+* TIFF Data Variable TIFF header, with associated
+* Standard IFD Data using, Nikon
+* Type 3 Tags. Offsets are from
+* this second tiff header
+* ----------------------------------------------------------------
+*
+* // Note: The Nikon Coolpix 775 uses the Fujifilm makernote format
+*
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Nikon_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Nikon_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Nikon_Makernote_Html";
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Nikon_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Nikon_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+ // Check if the Make Field contains the word Nikon
+ if ( stristr( $Make_Field, "Nikon" ) === FALSE )
+ {
+ // Nikon not found in maker field - abort
+ return FALSE;
+ }
+
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'],0 , 8 ) == "Nikon\x00\x01\x00" )
+ {
+ // Nikon Type 1 Makernote
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 8 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Nikon Type 1" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Nikon Type 1";
+ $Makernote_Tag['Makernote Tags'] = "Nikon Type 1";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+
+
+ }
+ else if ( ( substr( $Makernote_Tag['Data'],0 , 10 ) == "Nikon\x00\x02\x10\x00\x00" ) ||
+ ( substr( $Makernote_Tag['Data'],0 , 10 ) == "Nikon\x00\x02\x00\x00\x00" ) )
+ {
+ // Nikon Type 3 Makernote
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 10 );
+
+ // Read the TIFF header and IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = process_TIFF_Header( $filehnd, "Nikon Type 3" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Makernote Type'] = "Nikon Type 3";
+ $Makernote_Tag['Makernote Tags'] = "Nikon Type 3";
+ $Makernote_Tag['Decoded'] = TRUE;
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+ else if ( substr( $Makernote_Tag['Data'],0 , 8 ) == "FUJIFILM" )
+ {
+ // Fuji Makernote - used by Nikon Coolpix 775
+ // Let the Fujifilm library handle it
+ return False;
+ }
+ else
+ {
+ // No header - Nikon Type 2
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 0 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Nikon Type 3" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Nikon Type 2";
+ $Makernote_Tag['Makernote Tags'] = "Nikon Type 3";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+
+
+ // Shouldn't get here
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Nikon_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Nikon_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Nikon_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Nikon_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+
+ // Check that this tag uses the Nikon tags, otherwise it can't be interpreted here
+ // And check which variety of tags
+ if ( $Tag_Definitions_Name == "Nikon Type 1" )
+ {
+ // No special tags for Nikon type 1 so far
+ return FALSE;
+ }
+ else if ( $Tag_Definitions_Name == "Nikon Type 3" )
+ {
+ // Nikon Type 3 special tag
+
+ // Process tag according to it's tag number
+
+ if ( $Exif_Tag['Tag Number'] == 1) // Nikon Makernote Version - some are binary, some are text
+ {
+ return "\"" .HTML_UTF8_Escape( $Exif_Tag['Data'] ) . "\" (" . bin2hex( $Exif_Tag['Data'] ) . " hex)";
+ }
+
+ else if ( ( $Exif_Tag['Tag Number'] == 2 ) || // ISO Speed Used
+ ( $Exif_Tag['Tag Number'] == 19 ) ) // ISO Speed Requested
+ {
+ // ISO speed settings - should be the second of two values
+ if ( count( $Exif_Tag['Data'] ) == 2 )
+ {
+ // There are two values - display the second
+ return $Exif_Tag['Data'][1] . " " . $Exif_Tag['Units'];
+ }
+ else
+ {
+ // There is not two values - display generic version of values
+ return get_IFD_value_as_text( $Exif_Tag['Data'] ) . " " . $Exif_Tag['Units'];
+ }
+ }
+ else if ( $Exif_Tag['Tag Number'] == 137 ) // Bracketing & Shooting Mode
+ {
+ // Add shooting mode to output from first two bits
+ switch ( $Exif_Tag['Data'][0] & 0x03 )
+ {
+ case 0x00:
+ $outputstr = "Shooting Mode: Single Frame\n";
+ break;
+ case 0x01:
+ $outputstr = "Shooting Mode: Continuous\n";
+ break;
+ case 0x02:
+ $outputstr = "Shooting Mode: Self Timer\n";
+ break;
+ case 0x03:
+ $outputstr = "Shooting Mode: Remote??\n";
+ break;
+ default:
+ $outputstr = "Shooting Mode: Unknown\n";
+ break;
+ }
+
+ // Add flash bracketing to output from fifth bit
+ if ( ( $Exif_Tag['Data'][0] & 0x10 ) == 0x10 )
+ {
+ $outputstr .= "AE/Flash Bracketing On\n";
+ }
+ else
+ {
+ $outputstr .= "AE/Flash Bracketing Off\n";
+ }
+
+ // Add white balance bracketing to output from seventh bit
+ if ( ( $Exif_Tag['Data'][0] & 0x40 ) == 0x40 )
+ {
+ $outputstr .= "White Balance Bracketing On\n";
+ }
+ else
+ {
+ $outputstr .= "White Balance Bracketing Off\n";
+ }
+
+ // Return the output
+ return $outputstr;
+
+ }
+ else if ( $Exif_Tag['Tag Number'] == 136 ) // Auto Focus Area
+ {
+ // Create a string to receive the output
+ $outputstr = "";
+
+ // If all zeros, this could be manual focus
+ if ( $Exif_Tag['Data'] == "\x00\x00\x00\x00" )
+ {
+ $outputstr .= "Manual Focus, or\n";
+ }
+
+ // Add AF mode according to the first byte
+ switch ( ord($Exif_Tag['Data']{0}) )
+ {
+ case 0x00:
+ $outputstr .= "Auto Focus Mode: Single Area\n";
+ break;
+ case 0x01:
+ $outputstr .= "Auto Focus Mode: Dynamic Area\n";
+ break;
+ case 0x02:
+ $outputstr .= "Auto Focus Mode: Closest Subject\n";
+ break;
+ default:
+ $outputstr .= "Auto Focus Mode: Unknown AF Mode\n";
+ break;
+ }
+
+ // Add AF area according to second byte
+ switch ( ord($Exif_Tag['Data']{1}) )
+ {
+ case 0x00:
+ $outputstr .= "Auto Focus Area Selected: Centre\n";
+ break;
+ case 0x01:
+ $outputstr .= "Auto Focus Area Selected: Top\n";
+ break;
+ case 0x02:
+ $outputstr .= "Auto Focus Area Selected: Bottom\n";
+ break;
+ case 0x03:
+ $outputstr .= "Auto Focus Area Selected: Left\n";
+ break;
+ case 0x04:
+ $outputstr .= "Auto Focus Area Selected: Right\n";
+ break;
+ }
+
+ // Add properly focused areas to output according to byte 3 bits
+
+ $outputstr .= "Properly Focused Area(s): ";
+ if ( ord($Exif_Tag['Data']{3}) == 0x00 )
+ {
+ $outputstr .= "None";
+ }
+ if ( ( ord($Exif_Tag['Data']{3}) & 0x01 ) == 0x01 )
+ {
+ $outputstr .= "Centre ";
+ }
+ if ( ( ord($Exif_Tag['Data']{3}) & 0x02 ) == 0x02 )
+ {
+ $outputstr .= "Top ";
+ }
+ if ( ( ord($Exif_Tag['Data']{3}) & 0x04 ) == 0x04 )
+ {
+ $outputstr .= "Bottom ";
+ }
+ if ( ( ord($Exif_Tag['Data']{3}) & 0x08 ) == 0x08 )
+ {
+ $outputstr .= "Left ";
+ }
+ if ( ( ord($Exif_Tag['Data']{3}) & 0x10 ) == 0x10 )
+ {
+ $outputstr .= "Right ";
+ }
+ $outputstr .= "\n";
+
+ // return the string
+ return $outputstr;
+ }
+ else
+ {
+ // Unknown special tag
+ return FALSE;
+ }
+ }
+
+
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Nikon_Text_Value
+******************************************************************************/
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Nikon_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Nikon_Makernote_Html( $Makernote_tag, $filename )
+{
+
+ // Check that this is a Nikon Makernote, otherwise it can't be interpreted here
+ if ( ( $Makernote_tag['Makernote Type'] != "Nikon Type 1" ) &&
+ ( $Makernote_tag['Makernote Type'] != "Nikon Type 2" ) &&
+ ( $Makernote_tag['Makernote Type'] != "Nikon Type 3" ) )
+ {
+ // Not a Nikon Makernote - cannot interpret it - abort
+ return FALSE;;
+ }
+
+ // Interpret the IFD and return the HTML
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+}
+
+/******************************************************************************
+* End of Function: get_Nikon_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Nikon Type 1
+*
+* Contents: This global variable provides definitions of the known Nikon Type 1
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Nikon Type 1"] = array(
+
+
+3 => array( 'Name' => "Quality",
+ 'Description' => "1: VGA Basic, 2: VGA Normal, 3: VGA Fine, 4: SXGA Basic, 5: SXGA Normal, 6: SXGA Fine",
+ 'Type' => "Lookup",
+ 1 => "VGA (640x480) Basic",
+ 2 => "VGA (640x480) Normal",
+ 3 => "VGA (640x480) Fine",
+ 4 => "SXGA (1280x960) Basic",
+ 5 => "SXGA (1280x960) Normal",
+ 6 => "SXGA (1280x960) Fine",
+ 7 => "Unknown, Possibly XGA (1024x768) Basic",
+ 8 => "Unknown, Possibly XGA (1024x768) Basic",
+ 9 => "Unknown, Possibly XGA (1024x768) Basic",
+ 10 => "UXGA (1600x1200) Basic",
+ 11 => "UXGA (1600x1200) Normal",
+ 12 => "UXGA (1600x1200) Fine" ),
+
+4 => array( 'Name' => "Colour Mode",
+ 'Description' => "1: Colour, 2: Monochrome.",
+ 'Type' => "Lookup",
+ 1 => "Colour",
+ 2 => "Monochrome" ),
+
+5 => array( 'Name' => "Image Adjustment",
+ 'Description' => "0: Normal, 1: Bright+, 2: Bright-, 3: Contrast+, 4: Contrast-.",
+ 'Type' => "Lookup",
+ 0 => "Normal",
+ 1 => "Bright+",
+ 2 => "Bright-",
+ 3 => "Contrast+",
+ 4 => "Contrast-" ),
+
+6 => array( 'Name' => "CCD Sensitivity",
+ 'Description' => "0: ISO80, 2: ISO160, 4: ISO320, 5: ISO100",
+ 'Type' => "Lookup",
+ 0 => "ISO 80",
+ 2 => "ISO 160",
+ 4 => "ISO 320",
+ 5 => "ISO 100" ),
+
+7 => array( 'Name' => "White Balance",
+ 'Description' => "0: Auto, 1: Preset, 2: Daylight, 3: Incandescense, 4: Fluorescence, 5: Cloudy, 6: SpeedLight",
+ 'Type' => "Lookup",
+ 0 => "Auto",
+ 1 => "Preset",
+ 2 => "Daylight",
+ 3 => "Incandescense",
+ 4 => "Flourescence",
+ 5 => "Cloudy",
+ 6 => "Speedlight" ),
+
+8 => array( 'Name' => "Focus",
+ 'Description' => "If infinite focus, value is '1/0'.",
+ 'Type' => "Numeric" ),
+
+10 => array( 'Name' => "Digital Zoom",
+ 'Description' => "'160/100' means 1.6x digital zoom, '0/100' means no digital zoom (optical zoom only).",
+ 'Type' => "Numeric" ),
+
+11 => array( 'Name' => "Converter",
+ 'Description' => "If Fisheye Converter is used, value is 1",
+ 'Type' => "Lookup",
+ 0 => "No Converter Used",
+ 1 => "Fish-eye Converter Used" )
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Nikon Type 1
+******************************************************************************/
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Nikon Type 3
+*
+* Contents: This global variable provides definitions of the known Nikon Type 3
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Nikon Type 3"] = array(
+
+
+1 => array( 'Name' => "Nikon Makernote Version",
+ 'Type' => "Special" ),
+
+2 => array( 'Name' => "ISO Speed Used",
+ 'Type' => "Special" ),
+
+3 => array( 'Name' => "Colour Mode",
+ 'Type' => "String" ),
+
+4 => array( 'Name' => "Quality",
+ 'Type' => "String" ),
+
+5 => array( 'Name' => "White Balance",
+ 'Type' => "String" ),
+
+6 => array( 'Name' => "Sharpening",
+ 'Type' => "String" ),
+
+7 => array( 'Name' => "Focus Mode",
+ 'Type' => "String" ),
+
+8 => array( 'Name' => "Flash Setting",
+ 'Type' => "String" ),
+
+9 => array( 'Name' => "Auto Flash Mode",
+ 'Type' => "String" ),
+
+11 => array( 'Name' => "White Balance Bias Value",
+ 'Type' => "Numeric",
+ 'Units' => "(Units Approx: 100 Mired per increment)" ),
+
+12 => array( 'Name' => "White Balance Red, Blue Coefficients?",
+ 'Type' => "Numeric" ),
+
+15 => array( 'Name' => "ISO Selection?",
+ 'Type' => "String" ),
+
+
+18 => array( 'Name' => "Flash Compensation",
+ 'Type' => "Lookup",
+ 0x06 => "+1.0 EV",
+ 0x04 => "+0.7 EV",
+ 0x03 => "+0.5 EV",
+ 0x02 => "+0.3 EV",
+ 0x00 => "0.0 EV",
+ 0xfe => "-0.3 EV",
+ 0xfd => "-0.5 EV",
+ 0xfc => "-0.7 EV",
+ 0xfa => "-1.0 EV",
+ 0xf8 => "-1.3 EV",
+ 0xf7 => "-1.5 EV",
+ 0xf6 => "-1.7 EV",
+ 0xf4 => "-2.0 EV",
+ 0xf2 => "-2.3 EV",
+ 0xf1 => "-2.5 EV",
+ 0xf0 => "-2.7 EV",
+ 0xee => "-3.0 EV" ),
+
+19 => array( 'Name' => "ISO Speed Requested",
+ 'Type' => "Special",
+ 'Units' => "(May be different to Speed Used when Auto ISO is on)" ),
+
+
+22 => array( 'Name' => "Photo corner coordinates",
+ 'Type' => "Numeric",
+ 'Units' => "Pixels" ),
+
+24 => array( 'Name' => "Flash Bracket Compensation Applied",
+ 'Type' => "Lookup",
+ 0x06 => "+1.0 EV",
+ 0x04 => "+0.7 EV",
+ 0x03 => "+0.5 EV",
+ 0x02 => "+0.3 EV",
+ 0x00 => "0.0 EV",
+ 0xfe => "-0.3 EV",
+ 0xfd => "-0.5 EV",
+ 0xfc => "-0.7 EV",
+ 0xfa => "-1.0 EV",
+ 0xf8 => "-1.3 EV",
+ 0xf7 => "-1.5 EV",
+ 0xf6 => "-1.7 EV",
+ 0xf4 => "-2.0 EV",
+ 0xf2 => "-2.3 EV",
+ 0xf1 => "-2.5 EV",
+ 0xf0 => "-2.7 EV",
+ 0xee => "-3.0 EV" ),
+
+25 => array( 'Name' => "AE Bracket Compensation Applied",
+ 'Type' => "Numeric",
+ 'Units' => "EV" ),
+
+128 => array( 'Name' => "Image Adjustment?",
+ 'Type' => "String" ),
+
+129 => array( 'Name' => "Tone Compensation (Contrast)",
+ 'Type' => "String" ),
+
+130 => array( 'Name' => "Auxiliary Lens (Adapter)",
+ 'Type' => "String" ),
+
+131 => array( 'Name' => "Lens Type?",
+ 'Type' => "Lookup",
+ 6 => "Nikon D series Lens",
+ 14 => "Nikon G series Lens" ),
+
+132 => array( 'Name' => "Lens Min/Max Focal Length, Min/Max Aperture",
+ 'Type' => "Numeric",
+ 'Units' => " mm, mm, F#, F#" ),
+
+133 => array( 'Name' => "Manual Focus Distance?",
+ 'Type' => "Numeric"),
+
+134 => array( 'Name' => "Digital Zoom Factor?",
+ 'Type' => "Numeric" ),
+
+135 => array( 'Name' => "Flash Used",
+ 'Type' => "Lookup",
+ 0 => "Flash Not Used",
+ 9 => "Flash Fired" ),
+
+136 => array( 'Name' => "Auto Focus Area",
+ 'Description' => "byte 1 : AF Mode: 00 = single area, 01 = Dynamic Area, 02 = Closest Subject\n
+ byte 2 : AF Area Selected : 00 = Centre, 01 = Top, 02 = Bottom, 03 = Left, 04 = Right\n
+ byte 3 : Unknown, always zero\n
+ byte 4 : Properly focused Area(s) : bit 0 = Centre, bit 1 = Top, bit 2 = Bottom, bit 3 = Left, bit 4 = Right",
+ 'Type' => "Special" ),
+
+137 => array( 'Name' => "Bracketing & Shooting Mode",
+ 'Description' => "bit 0&1 (0 = single frame, 1 = continuous,2=timer, 3=remote timer? 4 = remote?\n
+ bit 4, Bracketing on or off\n
+ bit 6, white Balance Bracketing on",
+ 'Type' => "Special" ),
+
+141 => array( 'Name' => "Colour Mode",
+ 'Description' =>"1a = Portrait sRGB, 2 = Adobe RGB, 3a = Landscape sRGB",
+ 'Type' => "String" ),
+
+143 => array( 'Name' => "Scene Mode?",
+ 'Type' => "Numeric" ),
+
+144 => array( 'Name' => "Lighting Type",
+ 'Type' => "String" ),
+
+146 => array( 'Name' => "Hue Adjustment",
+ 'Type' => "Numeric",
+ 'Units' => "Degrees" ),
+
+148 => array( 'Name' => "Saturation?",
+ 'Type' => "Lookup",
+ -3 => "Black and White",
+ -2 => "-2",
+ -1 => "-1",
+ 0 => "Normal",
+ 1 => "+1",
+ 2 => "+2" ),
+
+149 => array( 'Name' => "Noise Reduction",
+ 'Type' => "String" ),
+
+167 => array( 'Name' => "Total Number of Shutter Releases for Camera",
+ 'Type' => "Numeric",
+ 'Units' => "Shutter Releases" ),
+
+169 => array( 'Name' => "Image optimisation",
+ 'Type' => "String" ),
+
+170 => array( 'Name' => "Saturation",
+ 'Type' => "String" ),
+
+171 => array( 'Name' => "Digital Vari-Program",
+ 'Type' => "String" )
+
+
+// Tags that exist but are unknown: 10, 13, 14, 16, 17, 23, 24, 138, 139, 145,
+// 151, 152, 160, 162 163, 165, 166, 168
+
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Nikon Type 3
+******************************************************************************/
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/olympus.php b/includes/jpeg_metadata_tk/Makernotes/olympus.php
new file mode 100644
index 0000000..a9717b0
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/olympus.php
@@ -0,0 +1,486 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: olympus.php
+*
+* Description: Olympus Makernote Parser
+* Provides functions to decode an Olympus EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Olympus Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 7 Bytes "OLYMP\x00\x01" or "OLYMP\x00\x02"
+* Unknown 1 Bytes Unknown
+* IFD Data Variable Standard IFD Data using Olympus Tags
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.11
+*
+* Changes: 1.00 -> 1.11 : changed get_Olympus_Makernote_Html to allow thumbnail links to work when
+* toolkit is portable across directories
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Olympus_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Olympus_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Olympus_Makernote_Html";
+
+
+
+
+include_once dirname(__FILE__) .'/../pjmt_utils.php'; // Change: as of version 1.11 - added to allow directory portability
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Olympus_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Olympus_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ // Check if the Make Field contains the word Olympus
+ if ( stristr( $Make_Field, "Olympus" ) === FALSE )
+ {
+ return FALSE;
+ }
+
+ // Check if the header exists at the start of the Makernote
+ if ( ( substr( $Makernote_Tag['Data'], 0, 7 ) != "OLYMP\x00\x01" ) &&
+ ( substr( $Makernote_Tag['Data'], 0, 7 ) != "OLYMP\x00\x02" ) )
+ {
+ // This isn't a Olympus Makernote, abort
+ return FALSE ;
+ }
+
+
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 8 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Olympus" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Olympus";
+ $Makernote_Tag['Makernote Tags'] = "Olympus";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+}
+
+/******************************************************************************
+* End of Function: get_Olympus_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Olympus_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Olympus_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Olympus_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+ // Check that this tag uses the Olympus tags, otherwise it can't be decoded here
+ if ( $Tag_Definitions_Name !== "Olympus" )
+ {
+ // Not an Olympus tag - can't decode it
+ return FALSE;
+ }
+
+
+ // Process the tag acording to it's tag number, to produce a text value
+ if ( $Exif_Tag['Tag Number'] == 0x200 )
+ {
+ // Special Mode Tag
+
+ // Add info from the first value to the output string
+ switch ( $Exif_Tag['Data'][0] )
+ {
+ case 0: $outputstr = "Normal\n";
+ break;
+ case 2: $outputstr = "Fast\n";
+ break;
+ case 3: $outputstr = "Panorama\n";
+ break;
+ default: $outputstr = "Unknown Mode ( " . $Exif_Tag['Data'][0] . " )\n";
+ break;
+ }
+
+ // Add info from the second value to the output string
+ $outputstr .= "Sequence Number: " . $Exif_Tag['Data'][1] . "\n";
+
+ // Add info from the third value to the output string
+ switch ( $Exif_Tag['Data'][2] )
+ {
+ case 0: // Do nothing
+ break;
+ case 1: $outputstr .= "Panorama Direction: Left to Right\n";
+ break;
+ case 2: $outputstr .= "Panorama Direction: Right to Left\n";
+ break;
+ case 3: $outputstr .= "Panorama Direction: Bottom to Top\n";
+ break;
+ case 4: $outputstr .= "Panorama Direction: Top to Bottom\n";
+ break;
+ default: $outputstr .= "Unknown Panorama Direction\n";
+ break;
+ }
+
+ // Return the output string
+ return $outputstr;
+ }
+ else
+ {
+ // Unknown special tag - can't process it here
+ return FALSE;
+ }
+
+ // Unknown special tag - can't process it here
+ return FALSE;
+
+}
+
+/******************************************************************************
+* End of Function: get_Olympus_Text_Value
+******************************************************************************/
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Olympus_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Olympus_Makernote_Html( $Makernote_tag, $filename )
+{
+
+ // Check that this tag uses the Olympus tags, otherwise it can't be interpreted here
+ if ( $Makernote_tag['Makernote Tags'] != "Olympus" )
+ {
+ // Not Olympus tags - can't interpret with this function
+ return FALSE;
+ }
+
+ // Check if the Decoded data is valid
+ if ( $Makernote_tag['Decoded Data'][0] === FALSE )
+ {
+ // Decoded data is not valid - can't interpret with this function
+ return FALSE;
+ }
+
+ // Minolta Thumbnail 1
+ if ( ( array_key_exists( 0x0088, $Makernote_tag['Decoded Data'][0] ) ) &&
+ ( $Makernote_tag['Makernote Tags'] == "Olympus" ) )
+ {
+ // Change: as of version 1.11 - Changed to make thumbnail link portable across directories
+ // Build the path of the thumbnail script and its filename parameter to put in a url
+ $link_str = get_relative_path( dirname(__FILE__) . "/../get_minolta_thumb.php" , getcwd ( ) );
+ $link_str .= "?filename=";
+ $link_str .= get_relative_path( $filename, dirname(__FILE__) ."/.." );
+
+ // Add thumbnail link to html
+ $Makernote_tag['Decoded Data'][0][0x0088]['Text Value'] = "<a class=\"EXIF_Minolta_Thumb_Link\" href=\"$link_str\" ><img class=\"EXIF_Minolta_Thumb\" src=\"$link_str\"></a>";
+
+ $Makernote_tag['Decoded Data'][0][0x0088]['Type'] = "String";
+ }
+ // Minolta Thumbnail 2
+ if ( ( array_key_exists( 0x0081, $Makernote_tag['Decoded Data'][0] ) ) &&
+ ( $Makernote_tag['Makernote Tags'] == "Olympus" ) )
+ {
+ // Change: as of version 1.11 - Changed to make thumbnail link portable across directories
+ // Build the path of the thumbnail script and its filename parameter to put in a url
+ $link_str = get_relative_path( dirname(__FILE__) . " /../get_minolta_thumb.php" , getcwd ( ) );
+ $link_str .= "?filename=";
+ $link_str .= get_relative_path( $filename, dirname(__FILE__) ."/.." );
+
+ // Add thumbnail link to html
+ $Makernote_tag['Decoded Data'][0][0x0081]['Text Value'] = "<a class=\"EXIF_Minolta_Thumb_Link\" href=\"$link_str\" ><img class=\"EXIF_Minolta_Thumb\" src=\"$link_str\"></a>";
+ $Makernote_tag['Decoded Data'][0][0x0081]['Type'] = "String";
+ }
+
+ // Interpret the IFD and return the HTML
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Olympus_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Olympus
+*
+* Contents: This global variable provides definitions of the known Olympus
+* Makernote tags, indexed by their tag number.
+* It also includes Minolta and Agfa tags, as they use many of the
+* same tags
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Olympus"] = array(
+
+0x0000 => array( 'Name' => "Makernote Version", // Minolta
+ 'Type' => "String" ),
+
+0x0001 => array( 'Name' => "Camera Settings", // Minolta
+ 'Type' => "Special" ),
+
+0x0003 => array( 'Name' => "Camera Settings", // Minolta
+ 'Type' => "Special" ),
+
+0x0040 => array( 'Name' => "Compressed Image Size", // Minolta
+ 'Type' => "Numeric",
+ 'Units' => "Bytes" ),
+
+0x0081 => array( 'Name' => "Minolta Thumbnail", // Minolta
+ 'Type' => "Special" ),
+
+0x0088 => array( 'Name' => "Minolta Thumbnail", // Minolta
+ 'Type' => "Special" ),
+
+0x0089 => array( 'Name' => "Minolta Thumbnail Length", // Minolta
+ 'Type' => "Numeric",
+ 'Units' => "bytes" ),
+
+0x0101 => array( 'Name' => "Colour Mode", // Minolta
+ 'Type' => "Lookup",
+ 0 => "Natural Colour",
+ 1 => "Black & White",
+ 2 => "Vivid colour",
+ 3 => "Solarization",
+ 4 => "AdobeRGB" ),
+
+0x0102 => array( 'Name' => "Image Quality", // Minolta
+ 'Type' => "Lookup",
+ 0 => "Raw",
+ 1 => "Super Fine",
+ 2 => "Fine",
+ 3 => "Standard",
+ 4 => "Extra Fine" ),
+
+0x0103 => array( 'Name' => "Image Quality?", // Minolta
+ 'Type' => "Lookup",
+ 0 => "Raw",
+ 1 => "Super Fine",
+ 2 => "Fine",
+ 3 => "Standard",
+ 4 => "Extra Fine" ),
+
+
+
+0x0200 => array( 'Name' => "Special Mode",
+ 'Type' => "Special" ),
+
+
+0x0201 => array( 'Name' => "JPEG Quality",
+ 'Type' => "Lookup",
+ 1 => "Standard Quality",
+ 2 => "High Quality",
+ 3 => "Super High Quality" ),
+
+0x0202 => array( 'Name' => "Macro",
+ 'Type' => "Lookup",
+ 0 => "Normal (Not Macro)",
+ 1 => "Macro" ),
+
+0x0204 => array( 'Name' => "Digital Zoom",
+ 'Type' => "Numeric",
+ 'Units' => " x Digital Zoom, (0 or 1 = normal)" ),
+
+0x0207 => array( 'Name' => "Firmware Version",
+ 'Type' => "String" ),
+
+
+0x0208 => array( 'Name' => "Picture Info Data",
+ 'Type' => "String" ),
+
+0x0209 => array( 'Name' => "Camera ID",
+ 'Type' => "String" ),
+
+
+0x020B => array( 'Name' => "Image Width", // Epson Tag
+ 'Type' => "Pixels" ),
+
+0x020C => array( 'Name' => "Image Height", // Epson Tag
+ 'Type' => "Pixels" ),
+
+0x020D => array( 'Name' => "Original Manufacturer Model?", // Epson Tag
+ 'Type' => "String" ),
+
+0x0E00 => array( 'Name'=> "Print Image Matching Info", // Minolta Tag
+ 'Type' => "PIM" ),
+
+0x1004 => array( 'Name' => "Flash Mode",
+ 'Type' => "Numeric" ),
+
+0x1006 => array( 'Name' => "Bracket",
+ 'Type' => "Numeric" ),
+
+0x100B => array( 'Name' => "Focus Mode",
+ 'Type' => "Numeric" ),
+
+0x100C => array( 'Name' => "Focus Distance",
+ 'Type' => "Numeric" ),
+
+0x100D => array( 'Name' => "Zoom",
+ 'Type' => "Numeric" ),
+
+0x100E => array( 'Name' => "Macro Focus",
+ 'Type' => "Numeric" ),
+
+0x100F => array( 'Name' => "Sharpness",
+ 'Type' => "Numeric" ),
+
+0x1011 => array( 'Name' => "Colour Matrix",
+ 'Type' => "Numeric" ),
+
+0x1012 => array( 'Name' => "Black Level",
+ 'Type' => "Numeric" ),
+
+0x1015 => array( 'Name' => "White Balance",
+ 'Type' => "Numeric" ),
+
+0x1017 => array( 'Name' => "Red Bias",
+ 'Type' => "Numeric" ),
+
+0x1018 => array( 'Name' => "Blue Bias",
+ 'Type' => "Numeric" ),
+
+0x101A => array( 'Name' => "Serial Number",
+ 'Type' => "Numeric" ),
+
+0x1023 => array( 'Name' => "Flash Bias",
+ 'Type' => "Numeric" ),
+
+0x1029 => array( 'Name' => "Contrast",
+ 'Type' => "Numeric" ),
+
+0x102A => array( 'Name' => "Sharpness Factor",
+ 'Type' => "Numeric" ),
+
+0x102B => array( 'Name' => "Colour Control",
+ 'Type' => "Numeric" ),
+
+0x102C => array( 'Name' => "Valid Bits",
+ 'Type' => "Numeric" ),
+
+0x102D => array( 'Name' => "Coring Filter",
+ 'Type' => "Numeric" ),
+
+0x102E => array( 'Name' => "Final Width",
+ 'Type' => "Numeric" ),
+
+0x102F => array( 'Name' => "Final Height",
+ 'Type' => "Numeric" ),
+
+0x1034 => array( 'Name' => "Compression Ratio",
+ 'Type' => "Numeric" ),
+
+
+
+);
+
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Olympus
+******************************************************************************/
+
+
+
+
+
+?> \ No newline at end of file
diff --git a/includes/jpeg_metadata_tk/Makernotes/panasonic.php b/includes/jpeg_metadata_tk/Makernotes/panasonic.php
new file mode 100644
index 0000000..2da827f
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/panasonic.php
@@ -0,0 +1,292 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: panasonic.php
+*
+* Description: Panasonic Makernote Parser
+* Provides functions to decode a Panasonic EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Panasonic Makernote Format:
+*
+* Type 1 - IFD form
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 12 Bytes "Panasonic\x00\x00\x00"
+* IFD Data Variable NON-Standard IFD Data using Panasonic Tags
+* There is no Next-IFD pointer after the IFD
+* ----------------------------------------------------------------
+*
+* Type 2 - Blank (Header only)
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 4 Bytes "MKED"
+* Junk 1 or 2 bytes Blank or Junk data
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Panasonic_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Panasonic_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Panasonic_Makernote_Html";
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Panasonic_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Panasonic_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+ // Check if the Make Field contains the word Panasonic
+ if ( stristr( $Make_Field, "Panasonic" ) === FALSE )
+ {
+ // No Panasonic in the maker - abort
+ return FALSE;
+ }
+
+
+ // Check if the header exists at the start of the Makernote
+ if ( substr( $Makernote_Tag['Data'], 0, 4 ) == "MKED" )
+ {
+ // Panasonic Type 2 - Empty Makernote
+ // No Makernote Data
+ $Makernote_Tag['Makernote Type'] = "Panasonic Empty Makernote";
+ $Makernote_Tag['Makernote Tags'] = "-";
+ $Makernote_Tag['Decoded'] = TRUE;
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+ else if ( substr( $Makernote_Tag['Data'], 0, 12 ) == "Panasonic\x00\x00\x00" )
+ {
+ // Panasonic Type 1 - IFD Makernote
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 12 );
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Panasonic", FALSE, FALSE );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Panasonic";
+ $Makernote_Tag['Makernote Tags'] = "Panasonic";
+
+ // Return the new tag
+ return $Makernote_Tag;
+ }
+ else
+ {
+ // Unknown Header
+ return FALSE;
+ }
+
+ // Shouldn't get here
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Panasonic_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Panasonic_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Panasonic_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Panasonic_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+
+ // Check that this tag uses the Olympus tags, otherwise it can't be decoded here
+ if ( $Tag_Definitions_Name == "Panasonic" )
+ {
+ // No Special Tags yet
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Panasonic_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Panasonic_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Panasonic_Makernote_Html( $Makernote_tag, $filename )
+{
+ if ( $Makernote_tag['Makernote Type'] == "Panasonic" )
+ {
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+ }
+ else if ( $Makernote_tag['Makernote Type'] == "Panasonic Empty Makernote" )
+ {
+ // Do Nothing
+ return "";
+ }
+ else
+ {
+ // Unknown Makernote Type
+ return FALSE;
+ }
+
+ // Shouldn't get here
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Panasonic_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Panasonic
+*
+* Contents: This global variable provides definitions of the known Panasonic
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Panasonic"] = array(
+
+0x01 => array( 'Name' => "Quality Mode",
+ 'Type' => "Numeric" ),
+
+0x02 => array( 'Name' => "Version",
+ 'Type' => "String" ),
+
+0x1c => array( 'Name' => "Macro Mode",
+ 'Type' => "Lookup",
+ 1 => "On",
+ 2 => "Off" ),
+
+0x1f => array( 'Name' => "Record Mode",
+ 'Type' => "Lookup",
+ 1 => "Normal",
+ 2 => "Portrait",
+ 9 => "Macro" ),
+
+0xE00 => array( 'Name' => "Print Image Matching Info",
+ 'Type' => "PIM" ),
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Panasonic
+******************************************************************************/
+
+
+
+
+
+?>
diff --git a/includes/jpeg_metadata_tk/Makernotes/ricoh.php b/includes/jpeg_metadata_tk/Makernotes/ricoh.php
new file mode 100644
index 0000000..f858bbc
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/ricoh.php
@@ -0,0 +1,415 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: ricoh.php
+*
+* Description: Ricoh Makernote Parser
+* Provides functions to decode an Ricoh EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Ricoh Makernote Format:
+*
+* Type 1 - Text Makernote
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Text Variable Text, beginning with "Rv" or "Rev"
+* ---------------------------------------------------------------
+*
+*
+* Type 2 - Empty Makernote
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Blank Variable Blank field filled with 0x00 characters
+* ---------------------------------------------------------------*
+*
+*
+* Type 3 - IFD Makernote
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 5 Bytes "Ricoh" or "RICOH"
+* Unknown 1 Byte Unknown field
+* Zeros 2 Bytes Two 0x00 characters
+* IFD Data Variable Standard IFD Data using Ricoh Tags
+* with Motorola byte alignment
+* ---------------------------------------------------------------
+*
+* Within Makernote Type 3, Tag 0x2001 is the Ricoh Camera Info Sub-IFD
+* It has the following format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 19 Bytes "[Ricoh Camera Info]"
+* Unknown 1 Byte Unknown field
+* IFD Data Variable NON-Standard IFD Data using Ricoh
+* Sub-IFD Tags with Motorola byte alignment
+* and has No final Next-IFD pointer
+* ---------------------------------------------------------------
+*
+*
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Ricoh_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Ricoh_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Ricoh_Makernote_Html";
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Ricoh_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Ricoh_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+ // Check if the Make Field contains the word Ricoh
+ if ( stristr( $Make_Field, "Ricoh" ) === FALSE )
+ {
+ // Ricoh not in the Maker field - abort
+ return FALSE;
+ }
+
+
+ // Check if the Text Makernote header exists at the start of the Makernote
+ if ( ( substr( $Makernote_Tag['Data'], 0, 2 ) === "Rv" ) ||
+ ( substr( $Makernote_Tag['Data'], 0, 3 ) === "Rev" ) )
+ {
+ // This is a text makernote - Label it as such
+ $Makernote_Tag['Makernote Type'] = "Ricoh Text";
+ $Makernote_Tag['Makernote Tags'] = "None";
+ $Makernote_Tag['Decoded'] = TRUE;
+
+ // Return the new Makernote tag
+ return $Makernote_Tag;
+
+ }
+ // Check if the Empty Makernote header exists at the start of the Makernote
+ else if ( $Makernote_Tag['Data'] === str_repeat ( "\x00", strlen( $Makernote_Tag['Data'] )) )
+ {
+ // This is an Empty Makernote - Label it as such
+ $Makernote_Tag['Makernote Type'] = "Ricoh Empty Makernote";
+ $Makernote_Tag['Makernote Tags'] = "None";
+ $Makernote_Tag['Decoded'] = TRUE;
+
+ // Return the new Makernote tag
+ return $Makernote_Tag;
+
+ }
+ // Check if the IFD Makernote header exists at the start of the Makernote
+ else if ( ( substr( $Makernote_Tag['Data'], 0, 5 ) === "RICOH" ) ||
+ ( substr( $Makernote_Tag['Data'], 0, 5 ) === "Ricoh" ) )
+ {
+ //This is an IFD Makernote
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 8 );
+
+ // Ricoh Makernote always uses Motorola Byte Alignment
+ $Makernote_Tag['ByteAlign'] = "MM";
+
+ // Read the IFD(s) into an array
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Ricoh" );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Ricoh";
+ $Makernote_Tag['Makernote Tags'] = "Ricoh";
+
+ // Ricoh Makernotes can have a tag 0x2001 which is a Sub-IFD
+ // Check if the tag exists
+ if ( ( $Makernote_Tag['Decoded Data'][0] !== FALSE ) &&
+ ( array_key_exists( 0x2001, $Makernote_Tag['Decoded Data'][0] ) ) )
+ {
+ // Ricoh Sub-IFD tag exists - Process it
+
+ // Grab the Sub-IFD tag for easier processing
+ $SubIFD_Tag = &$Makernote_Tag['Decoded Data'][0][0x2001];
+
+ // Check if the Sub-IFD starts with the correct header
+ if ( substr( $SubIFD_Tag['Data'], 0, 19 ) === "[Ricoh Camera Info]" )
+ {
+ // Correct Header found
+
+ // Seek to the start of the Sub-IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $SubIFD_Tag['Offset'] + 20 );
+
+ // Ricoh Makernote Sub-IFD always uses Motorola Byte Alignment
+ $SubIFD_Tag['ByteAlign'] = "MM";
+
+
+ // Read the IFD(s) into an array
+ $SubIFD_Tag['Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $SubIFD_Tag['ByteAlign'], "RicohSubIFD", False, False );
+
+ // Save some information into the Tag element to aid interpretation
+ $SubIFD_Tag['Decoded'] = TRUE;
+ $SubIFD_Tag['Makernote Type'] = "Ricoh";
+ $SubIFD_Tag['Makernote Tags'] = "RicohSubIFD";
+
+ // Change the tag type to a Sub-IFD so it is handled automatically for interpretation
+ $SubIFD_Tag['Type'] = "SubIFD";
+ $SubIFD_Tag['Tags Name'] = "RicohSubIFD";
+
+ }
+ else
+ {
+ // Couldn't find header of Sub-IFD - Probably corrupt
+ $SubIFD_Tag['Type'] = "String";
+ $SubIFD_Tag['Text Value'] = "Corrupted Ricoh Sub IFD";
+ }
+
+ }
+
+ // Return the new makernote tag
+ return $Makernote_Tag;
+ }
+ else
+ {
+ // Unrecognised header for makernote - abort
+ return FALSE;
+ }
+
+ // Shouldn't get here
+ return False;
+}
+
+/******************************************************************************
+* End of Function: get_Ricoh_Makernote
+******************************************************************************/
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Ricoh_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Ricoh_Makernote_Html( $Makernote_tag, $filename )
+{
+
+ // Check if this makernote is Ricoh IFD type
+ if ( $Makernote_tag['Makernote Type'] == "Ricoh" )
+ {
+ // This is a Ricoh IFD makernote - interpret it
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+ }
+ // Check if this makernote is Ricoh Text type
+ else if ( $Makernote_tag['Makernote Type'] == "Ricoh Text" )
+ {
+ // This is a Ricoh text makernote
+ // Construct the start of enclosing html for the text
+ $output_str = "<table class=\"EXIF_Table\"border=1><tr class=\"EXIF_Table_Row\"><td class=\"EXIF_Value_Cell\">";
+
+ // Replace the semicolon dividers with line break html tags
+ $output_str .= str_replace ( ";", "<BR>\n", $Makernote_tag['Data'] );
+
+ // Close the html
+ $output_str .= "</td></tr></table>";
+
+ // Return the html
+ return $output_str;
+ }
+ // Check if this makernote is a Ricoh Empty makernote
+ else if ( $Makernote_tag['Makernote Type'] == "Ricoh Empty Makernote" )
+ {
+ // Do Nothing
+ return "";
+ }
+ else
+ {
+ // Don't recognise the Makernote type - not a Ricoh makernote
+ return FALSE;
+ }
+
+ // shouldn't get here
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Ricoh_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Ricoh_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Ricoh_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Ricoh_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+
+ // Check that this tag uses the Ricoh tags, otherwise it can't be decoded here
+ if ( $Tag_Definitions_Name == "Ricoh" )
+ {
+
+ // Process the tag acording to it's tag number, to produce a text value
+ if ( $Exif_Tag['Tag Number'] == 0x0002 ) // Version tag
+ {
+ $tmp = implode ( "\x00", $Exif_Tag['Data']);
+ return "\"" .HTML_UTF8_Escape( $tmp ) . "\" (" . bin2hex( $tmp ) . " hex)";
+ }
+
+ }
+
+ // Unknown tag or tag definitions
+ return FALSE;
+
+}
+
+/******************************************************************************
+* End of Function: get_Ricoh_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Ricoh
+*
+* Contents: This global variable provides definitions of the known Ricoh
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Ricoh"] = array(
+
+
+0x0001 => array( 'Name' => "Makernote Data Type",
+ 'Type' => "String" ),
+
+0x0002 => array( 'Name' => "Version",
+ 'Type' => "Special" ),
+
+0x0e00 => array( 'Name' => "Print Image Matching Info",
+ 'Type' => "PIM" ),
+
+0x2001 => array( 'Name' => "Ricoh Camera Info Makernote Sub-IFD",
+ 'Type' => "Special" ),
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Ricoh
+******************************************************************************/
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, RicohSubIFD
+*
+* Contents: This global variable provides definitions of the known Ricoh
+* Camera Info Sub-IFD Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["RicohSubIFD"] = array(
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, RicohSubIFD
+******************************************************************************/
+
+
+
+
+
+
+?> \ No newline at end of file
diff --git a/includes/jpeg_metadata_tk/Makernotes/sony.php b/includes/jpeg_metadata_tk/Makernotes/sony.php
new file mode 100644
index 0000000..2690d81
--- /dev/null
+++ b/includes/jpeg_metadata_tk/Makernotes/sony.php
@@ -0,0 +1,244 @@
+<?php
+
+/******************************************************************************
+*
+* Filename: sony.php
+*
+* Description: Sony Makernote Parser
+* Provides functions to decode an Sony EXIF makernote and to interpret
+* the resulting array into html.
+*
+* Sony Makernote Format:
+*
+* Field Size Description
+* ----------------------------------------------------------------
+* Header 12 Bytes "SONY CAM \x00\x00\x00"
+* or
+* "SONY DSC \x00\x00\x00"
+* IFD Data Variable NON-Standard IFD Data using Sony Tags
+* IFD has no Next-IFD pointer at end of IFD,
+* ----------------------------------------------------------------
+*
+*
+* Author: Evan Hunter
+*
+* Date: 30/7/2004
+*
+* Project: JPEG Metadata
+*
+* Revision: 1.00
+*
+* URL: http://electronics.ozhiker.com
+*
+* Copyright: Copyright Evan Hunter 2004
+* This file may be used freely for non-commercial purposes.For
+* commercial uses please contact the author: evan@ozhiker.com
+*
+******************************************************************************/
+
+
+
+
+// Add the parser and interpreter functions to the list of Makernote parsers and interpreters.
+
+$GLOBALS['Makernote_Function_Array']['Read_Makernote_Tag'][] = "get_Sony_Makernote";
+$GLOBALS['Makernote_Function_Array']['get_Makernote_Text_Value'][] = "get_Sony_Text_Value";
+$GLOBALS['Makernote_Function_Array']['Interpret_Makernote_to_HTML'][] = "get_Sony_Makernote_Html";
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Sony_Makernote
+*
+* Description: Decodes the Makernote tag and returns the new tag with the decoded
+* information attached. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* EXIF_Array - the entire EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG, in
+* case more information is required for decoding
+* filehnd - an open file handle for the file containing the
+* makernote - does not have to be positioned at the
+* start of the makernote
+* Make_Field - The contents of the EXIF Make field, to aid
+* determining whether this script can decode
+* the makernote
+*
+*
+* Returns: Makernote_Tag - the Makernote_Tag from the parameters, but
+* modified to contain the decoded information
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Sony_Makernote( $Makernote_Tag, $EXIF_Array, $filehnd, $Make_Field )
+{
+
+ // Check if the Make Field contains the word Sony
+ if ( stristr( $Make_Field, "Sony" ) === FALSE )
+ {
+ // This isn't a Sony makernote
+ return FALSE;
+ }
+
+ // Check if the header exists at the start of the Makernote
+ if ( ( substr( $Makernote_Tag['Data'], 0, 12 ) != "SONY CAM \x00\x00\x00" ) &&
+ ( substr( $Makernote_Tag['Data'], 0, 12 ) != "SONY DSC \x00\x00\x00" ) )
+ {
+ // This isn't a Sony Makernote, abort
+ return FALSE ;
+ }
+
+ // Seek to the start of the IFD
+ fseek($filehnd, $Makernote_Tag['Tiff Offset'] + $Makernote_Tag['Offset'] + 12 );
+
+ // Read the IFD(s) into an array
+
+
+ $Makernote_Tag['Decoded Data'] = read_Multiple_IFDs( $filehnd, $Makernote_Tag['Tiff Offset'], $Makernote_Tag['ByteAlign'], "Sony", FALSE, FALSE );
+
+ // Save some information into the Tag element to aid interpretation
+ $Makernote_Tag['Decoded'] = TRUE;
+ $Makernote_Tag['Makernote Type'] = "Sony";
+ $Makernote_Tag['Makernote Tags'] = "sony";
+
+
+ // Return the new tag
+ return $Makernote_Tag;
+
+
+}
+
+/******************************************************************************
+* End of Function: get_Sony_Makernote
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Sony_Text_Value
+*
+* Description: Provides a text value for any tag marked as special for makernotes
+* that this script can decode. Returns false if this is not a makernote
+* that can be processed with this script
+*
+* Parameters: Exif_Tag - the element of an the Makernote array containing the
+* tag in question, as returned from get_Sony_Makernote
+* Tag_Definitions_Name - The name of the Tag Definitions group
+* within the global array IFD_Tag_Definitions
+*
+*
+* Returns: output - the text value for the tag
+* FALSE - If this script could not decode the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Sony_Text_Value( $Exif_Tag, $Tag_Definitions_Name )
+{
+ // Check that this tag uses the Sony tags, otherwise it can't be decoded here
+ if ( $Tag_Definitions_Name == "Sony" )
+ {
+ // No Special Tags yet
+ return FALSE;
+ }
+
+ return FALSE;
+}
+
+/******************************************************************************
+* End of Function: get_Sony_Text_Value
+******************************************************************************/
+
+
+
+
+
+
+/******************************************************************************
+*
+* Function: get_Sony_Makernote_Html
+*
+* Description: Attempts to interpret a makernote into html. Returns false if
+* it is not a makernote that can be processed with this script
+*
+* Parameters: Makernote_Tag - the element of an EXIF array containing the
+* makernote, as returned from get_EXIF_JPEG
+* filename - the name of the JPEG file being processed ( used
+* by scripts which display embedded thumbnails)
+*
+*
+* Returns: output - the html representing the makernote
+* FALSE - If this script could not interpret the makernote, or if
+* an error occured in decoding
+*
+******************************************************************************/
+
+function get_Sony_Makernote_Html( $Makernote_tag, $filename )
+{
+
+ // Check that this tag uses the Sony tags, otherwise it can't be interpreted here
+ if ( $Makernote_tag['Makernote Type'] != "Sony" )
+ {
+ // Not Sony tags - can't interpret with this function
+ return FALSE;
+ }
+
+ // Interpret the IFD and return the HTML
+ return interpret_IFD( $Makernote_tag['Decoded Data'][0], $filename );
+
+}
+
+/******************************************************************************
+* End of Function: get_Sony_Makernote_Html
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+/******************************************************************************
+* Global Variable: IFD_Tag_Definitions, Sony
+*
+* Contents: This global variable provides definitions of the known Sony
+* Makernote tags, indexed by their tag number.
+*
+******************************************************************************/
+
+$GLOBALS[ "IFD_Tag_Definitions" ]["Sony"] = array(
+
+0xE00 => array( 'Name' => "Print Image Matching Info",
+ 'Type' => "PIM" ),
+
+);
+
+/******************************************************************************
+* End of Global Variable: IFD_Tag_Definitions, Sony
+******************************************************************************/
+
+
+
+
+
+
+
+
+
+
+
+?>