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(0x88, $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][0x88]['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][0x88]['Type'] = "String";
}
// Minolta Thumbnail 2
if (array_key_exists(0x81, $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][0x81]['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][0x81]['Type'] = "String";
}
// Interpret the IFD and return the HTML
return interpret_IFD($Makernote_tag['Decoded Data'][0], $filename);
}
开发者ID:shen0834,项目名称:util,代码行数:37,代码来源:olympus.php
示例4: Copyright
?>
, Copyright (C) 2004 Evan Hunter</a></p> <!-- Change: displayed toolkit version numbers to reference Toolkit_Version.php - as of version 1.11 -->
<br>
<br>
<h1><B><U>Metadata for "<?php
echo $filename;
?>
"</U></B></h1>
<br>
<!-- Output a link allowing user to edit the Photoshop File Info
Change: Allow this example file to be easily relocatable - as of version 1.11
-->
<?php
$relative_filename = get_relative_path($filename, $Toolkit_Dir);
?>
<h4><a href="<?php
echo $Toolkit_Dir . "Edit_File_Info_Example.php?jpeg_fname={$relative_filename}";
?>
" >Click here to edit the Photoshop File Info for this file</a></h4>
<br>
Output the information about the APP segments -->
<?php
echo Generate_JPEG_APP_Segment_HTML($jpeg_header_data);
?>
<BR>
function interpret_IFD($IFD_array, $filename)
{
// Create the output string with the table tag
$output_str = "<table class=\"EXIF_Table\" border=1>\n";
// Create an extra output string to receive any supplementary html
// which cannot go inside the table
$extra_IFD_str = "";
// Check that the IFD array is valid
if ($IFD_array === FALSE || $IFD_array === NULL) {
// the IFD array is NOT valid - exit
return "";
}
// Check if this is an EXIF IFD and if there is a makernote present
if ($IFD_array['Tags Name'] === "EXIF" && !array_key_exists(37500, $IFD_array)) {
// This is an EXIF IFD but NO makernote is present - Add a message to the output
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">No Makernote Present</h3>";
}
// Cycle through each tag in the IFD
foreach ($IFD_array as $Tag_ID => $Exif_Tag) {
// Ignore the non numeric elements - they aren't tags
if (!is_numeric($Tag_ID)) {
// Skip Tags Name
} else {
if ($Exif_Tag['Decoded'] == TRUE) {
// This tag has been successfully decoded
// Table cells won't get drawn with nothing in them -
// Ensure that at least a non breaking space exists in them
if (trim($Exif_Tag['Text Value']) == "") {
$Exif_Tag['Text Value'] = " ";
}
// Check if the tag is a sub-IFD
if ($Exif_Tag['Type'] == "SubIFD") {
// This is a sub-IFD tag
// Add a sub-heading for the sub-IFD
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">" . $Exif_Tag['Tag Name'] . " contents</h3>";
// Cycle through each sub-IFD in the chain
foreach ($Exif_Tag['Data'] as $subIFD) {
// Interpret this sub-IFD and add the html to the secondary output
$extra_IFD_str .= interpret_IFD($subIFD, $filename);
}
} else {
if ($Exif_Tag['Type'] == "Maker Note") {
// This is a Makernote Tag
// Add a sub-heading for the Makernote
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">Maker Note Contents</h3>";
// Interpret the Makernote and add the html to the secondary output
$extra_IFD_str .= Interpret_Makernote_to_HTML($Exif_Tag, $filename);
} else {
if ($Exif_Tag['Type'] == "IPTC") {
// This is a IPTC/NAA Record, interpret it and output to the secondary html
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">Contains IPTC/NAA Embedded in EXIF</h3>";
$extra_IFD_str .= Interpret_IPTC_to_HTML($Exif_Tag['Data']);
} else {
if ($Exif_Tag['Type'] == "XMP") {
// This is a XMP Record, interpret it and output to the secondary html
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">Contains XMP Embedded in EXIF</h3>";
$extra_IFD_str .= Interpret_XMP_to_HTML($Exif_Tag['Data']);
} else {
if ($Exif_Tag['Type'] == "IRB") {
// This is a Photoshop IRB Record, interpret it and output to the secondary html
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">Contains Photoshop IRB Embedded in EXIF</h3>";
$extra_IFD_str .= Interpret_IRB_to_HTML($Exif_Tag['Data'], $filename);
} else {
if ($Exif_Tag['Type'] == "Numeric") {
// Numeric Tag - Output text value as is.
$output_str .= "<tr class=\"EXIF_Table_Row\"><td class=\"EXIF_Caption_Cell\">" . $Exif_Tag['Tag Name'] . "</td><td class=\"EXIF_Value_Cell\">" . $Exif_Tag['Text Value'] . "</td></tr>\n";
} else {
// Other tag - Output text as preformatted
$output_str .= "<tr class=\"EXIF_Table_Row\"><td class=\"EXIF_Caption_Cell\">" . $Exif_Tag['Tag Name'] . "</td><td class=\"EXIF_Value_Cell\"><pre>" . trim($Exif_Tag['Text Value']) . "</pre></td></tr>\n";
}
}
}
}
}
}
} else {
// Tag has NOT been decoded successfully
// Hence it is either an unknown tag, or one which
// requires processing at the time of html construction
// Table cells won't get drawn with nothing in them -
// Ensure that at least a non breaking space exists in them
if (trim($Exif_Tag['Text Value']) == "") {
$Exif_Tag['Text Value'] = " ";
}
// Check if this tag is the first IFD Thumbnail
if ($IFD_array['Tags Name'] == "TIFF" && $Tag_ID == 513) {
// This is the first IFD thumbnail - Add html to the output
// 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_exif_thumb.php", getcwd());
$link_str .= "?filename=";
$link_str .= get_relative_path($filename, dirname(__FILE__));
// Add thumbnail link to html
$output_str .= "<tr class=\"EXIF_Table_Row\"><td class=\"EXIF_Caption_Cell\">" . $Exif_Tag['Tag Name'] . "</td><td class=\"EXIF_Value_Cell\"><a class=\"EXIF_First_IFD_Thumb_Link\" href=\"{$link_str}\"><img class=\"EXIF_First_IFD_Thumb\" src=\"{$link_str}\"></a></td></tr>\n";
} else {
if ($Exif_Tag['Type'] == "Maker Note") {
// This is the makernote, but has not been decoded
// Add a message to the secondary output
$extra_IFD_str .= "<h3 class=\"EXIF_Secondary_Heading\">Makernote Coding Unknown</h3>\n";
} else {
//.........这里部分代码省略.........
开发者ID:evanhunter,项目名称:PJMT,代码行数:101,代码来源:EXIF.php
示例6: get_Casio_Makernote_Html
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);
}
function navbar_html($navbar = NULL)
{
if (is_null($navbar)) {
global $navbar_array;
$navbar = $navbar_array;
}
$html = '';
foreach ($navbar as $key => $nav_elem) {
if (is_array($nav_elem)) {
if (user_access($key)) {
//If it's a section and it's allowed, then recursively continue flattening the array.
$html .= navbar_html($nav_elem);
}
} elseif ($nav_elem === '') {
$html .= "</div><div class='linkgroup'>";
} elseif (is_string($key)) {
//In this case $key is the name, $nav_elem is the path.
if ($nav_elem === get_relative_path()) {
//In this case it's the current page, so indicate so.
$html .= "<span class='selected'>{$key}</span><br />";
} else {
$html .= "<a href='" . URL::root() . "/{$nav_elem}'>{$key}</a><br />";
}
} else {
//In this case $nav_elem is both the name and the path.
if ($nav_elem === get_relative_path()) {
//In this case it's the current page, so indicate so.
$html .= "<span class='selected'>{$nav_elem}</span><br />";
} else {
$html .= "<a href='" . URL::root() . "/{$nav_elem}'>{$nav_elem}</a><br />";
}
}
}
return $html;
}
obj.style.display='none';
btn.style.display = '';
}
}
<?php
}
?>
<?php
// When uploading a file as an alternative content, set the alternative field in the opener window
// and close "file manager" once the upload is successful
if ($a_type > 0 && isset($_GET['uploadfile']) && $_GET['uploadfile'] != '') {
?>
function setAlternativeAndClose() {
setAlternative('<?php
echo get_relative_path($_GET['cp'], $pathext) . $_GET['uploadfile'];
?>
', '<?php
echo TR_BASE_HREF . $get_file . $pathext . urlencode($_GET['uploadfile']);
?>
', '<?php
echo $_content_id;
?>
', '<?php
echo $pid;
?>
', '<?php
echo $a_type;
?>
');
window.close();
}
// set a cookie
function setCheckboxCookie(obj, value1, value2, date)
{
var today = new Date();
var the_date = new Date(date);
var the_cookie_date = the_date.toGMTString();
if (obj.checked==true)
var the_cookie = value1 + ";expires=" + the_cookie_date;
else
var the_cookie = value2 + ";expires=" + the_cookie_date;
document.cookie = the_cookie;
}
<?php endif; ?>
<?php
// When uploading a file as an alternative content, set the alternative field in the opener window
// and close "file manager" once the upload is successful
if ($a_type > 0 && isset($_GET['uploadfile']) && $_GET['uploadfile'] <> '') { ?>
function setAlternativeAndClose() {
setAlternative('<?php echo get_relative_path($_GET['cp'], $pathext).$_GET['uploadfile']; ?>', '<?php echo AT_BASE_HREF.$get_file.$pathext.urlencode($_GET['uploadfile']); ?>', '<?php echo $cid; ?>', '<?php echo $pid; ?>', '<?php echo $a_type; ?>');
window.close();
}
window.onload=setAlternativeAndClose;
<?php } ?>
//-->
</script>
function get_reportico_url_path()
{
$newpath = "reportico.php";
$found = find_file_to_include($newpath, $newpath, $reltoinclude);
$newpath = get_relative_path(str_replace("/", "\\", realpath($newpath)), dirname(realpath($_SERVER["SCRIPT_FILENAME"])));
$above = dirname($_SERVER["SCRIPT_NAME"]);
if ($above == "/") {
$above = "";
}
$url_path = $above . "/" . session_request_item('reporticourl', dirname($newpath));
// If reportico source files are installed in root directory or in some other
// scenarios such as an invalid linkbaseurl parameter the dirname of the
// the reportico files returns just a slash (backslash on windows) so
// return a true path
if ($url_path == "/" || $url_path == "\\") {
$url_path = "/";
} else {
$url_path = $url_path . "/";
}
return $url_path;
}
function Interpret_JFXX_to_HTML($JFXX_array, $filename)
{
$output = "";
if ($JFXX_array !== FALSE) {
$output .= "<H2 class=\"JFXX_Main_Heading\">Contains JPEG File Interchange Extension Format (JFXX) Thumbnail</H2>\n";
switch ($JFXX_array['Extension_Code']) {
case 0x10:
$output .= "<p class=\"JFXX_Text\">JFXX Thumbnail is JPEG Encoded</p>\n";
// 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_JFXX_thumb.php", getcwd());
$link_str .= "?filename=";
$link_str .= get_relative_path($filename, dirname(__FILE__));
// Add thumbnail link to html
$output .= "<a class=\"JFXX_Thumbnail_Link\" href=\"{$link_str}\"><img class=\"JFXX_Thumbnail\" src=\"{$link_str}\"></a>\n";
break;
case 0x11:
$output .= "<p class=\"JFXX_Text\">JFXX Thumbnail is Encoded 1 byte/pixel</p>\n";
$output .= "<p class=\"JFXX_Text\">Thumbnail Display Not Implemented Yet</p>\n";
break;
case 0x13:
$output .= "<p class=\"JFXX_Text\">JFXX Thumbnail is Encoded 3 bytes/pixel</p>\n";
$output .= "<p class=\"JFXX_Text\">Thumbnail Display Not Implemented Yet</p>\n";
break;
default:
$output .= "<p class=\"JFXX_Text\">JFXX Thumbnail is Encoded with Unknown format</p>\n";
break;
// TODO: Implement JFXX one and three bytes per pixel thumbnail decoding
}
}
return $output;
}
请发表评论