📄 ricoh.php
字号:
// 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
******************************************************************************/
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -