Esempio n. 1
0
 function upload()
 {
     import("ORG.Net.Image3");
     if (!empty($_FILES)) {
         //获取文件名
         $tempFile = $_FILES['Filedata']['tmp_name'];
         //保存路径
         $targetPath = APP_PATH . 'Public/Uploads/';
         //新图片名
         $new_file_name = new_name($_FILES['Filedata']['name']);
         //图片网站路径
         $targetFile = $targetPath . $new_file_name;
         //判断是否文件夹存在
         if (!is_dir($targetPath)) {
             mkdir($targetPath, 0777, true);
         }
         //防止中文文件名乱码
         move_uploaded_file($tempFile, iconv('utf-8', 'gbk', $targetFile));
         //水印
         $water = '';
         $img = new Image3();
         $img->param($targetFile)->water($targetFile, $water, 9);
         //ajax返回图片名称
         echo get_relative_path($new_file_name);
     }
 }
 /**
  * Get relative path to a directory/file
  * @param  string  $path         Path to a directory/file
  * @param  boolean $use_doc_root Use document root or relative path?
  * @return string
  */
 function get_path($path, $use_doc_root = false)
 {
     $doc_root = DOCUMENT_ROOT;
     if (!$use_doc_root) {
         $doc_root = get_relative_path();
     }
     return join_path(preg_replace('/(\\/)+$/', '', $doc_root), preg_replace('/^(\\/+)/', '', $path));
 }
Esempio n. 3
0
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);
}
Esempio n. 4
0
?>
, 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 &quot;<?php 
echo $filename;
?>
&quot;</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>
Esempio n. 5
0
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'] = "&nbsp;";
                }
                // 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'] = "&nbsp;";
                }
                // 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 {
                        // This is an Unknown Tag
                        // Check if the user wants to hide unknown tags
                        if ($GLOBALS['HIDE_UNKNOWN_TAGS'] === FALSE) {
                            // User wants to display unknown tags
                            // Check if the Data is an ascii string
                            if ($Exif_Tag['Data Type'] == 2) {
                                // This is a Ascii String field - add it preformatted to the output
                                $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 {
                                // Not an ASCII string - add it as is to the output
                                $output_str .= "<tr class=\"EXIF_Table_Row\"><td class=\"EXIF_Caption_Cell\">" . $Exif_Tag['Tag Name'] . "</td><td class=\"EXIF_Value_Cell\">" . trim($Exif_Tag['Text Value']) . "</td></tr>\n";
                            }
                        }
                    }
                }
            }
        }
    }
    // Close the table in the output
    $output_str .= "</table>\n";
    // Add the secondary output at the end of the main output
    $output_str .= "{$extra_IFD_str}\n";
    // Return the resulting html
    return $output_str;
}
Esempio n. 6
0
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);
}
Esempio n. 7
0
        $header_class = 'noPrint';
    }
}
$lmt_main_navbar = array('Math Club Home' => 'Home', backstage_is_open() ? 'ARL' : 'A' => ['Backstage' => 'LMT/Backstage/Home'], '');
$result = DB::query('SELECT page_id, name FROM pages ORDER BY order_num');
foreach ($result as $row) {
    if ($row['page_id'] == '-1') {
        if (registration_is_open()) {
            $lmt_main_navbar['Registration'] = 'LMT/Registration/Home';
            $lmt_main_navbar[] = '';
        }
    } else {
        if ($row['name'] == '') {
            $lmt_main_navbar[] = '';
        } else {
            $lmt_main_navbar[$row['name']] = 'LMT/' . str_replace(' ', '_', $row['name']);
        }
    }
}
$lmt_backstage_navbar = array('ARL' => ['LMT Home' => 'LMT', 'Backstage Home' => 'LMT/Backstage/Home', 'A' => ['', 'Status' => 'LMT/Backstage/Status', 'Website' => 'LMT/Backstage/Pages/List', 'Email' => 'LMT/Backstage/Email/Home', 'Export' => 'LMT/Backstage/Export'], '', 'Check-in' => 'LMT/Backstage/Checkin/Home', 'Score Entry' => 'LMT/Backstage/Scoring/Home', 'Guts Round' => 'LMT/Backstage/Guts/Home', 'Results' => 'LMT/Backstage/Results/Full', '', 'Data' => 'LMT/Backstage/Data/Home', 'Verification' => 'LMT/Backstage/Database/Verify', 'Backup' => 'LMT/Backstage/Database/Backup']);
if (strpos(get_relative_path(), 'Backstage') === 4) {
    //position 4, because it's after 'LMT/'
    if (backstage_is_open()) {
        restrict_access('ARL');
    } else {
        restrict_access('A');
    }
    set_navbar($lmt_backstage_navbar);
} else {
    set_navbar($lmt_main_navbar);
}
$webdlmon_pf = 'webdlmon.pf';
pfupdate($webdlmon_pf);
$pf_change_time = "1182297600";
if (pfrequire($webdlmon_pf, $pf_change_time) < 0) {
    die("<b><u>Webdlmon Error:</u></b>\n\t\tThe parameter file {$webdlmon_pf}.pf is out of date. \n\t\tPlease upgrade to the latest version. Goodbye.");
}
$sources = pfget($webdlmon_pf, 'sources');
$dlmon_pf = $sources['dlmon_pf'];
$optional = pfget($webdlmon_pf, 'optional');
$table_caption = trim($optional['table_caption'], "'\"");
$dataloggers = pfget($webdlmon_pf, 'dataloggers');
$dlmodel = trim($dataloggers['model'], "'\"");
$customization = pfget($webdlmon_pf, 'customization');
if ($customization['customize'] == 'true') {
    $cookie_name = $customization['cookie_name'];
    $cookie_domain = get_relative_path(dirname(__FILE__));
    if (!empty($_POST['submit']) && !empty($_POST['cookie'])) {
        ksort($_POST['cookie']);
        $cookie_val = implode('|', $_POST['cookie']);
        $cookie_expire = time() + 60 * 60 * 24 * 365;
        // One year from now
        setcookie($cookie_name, $cookie_val, $cookie_expire, $cookie_domain);
    } else {
        // Make sure we delete the old cookie, browser specific
        // See http://www.php.net/setcookie
        if (eregi('MSIE', $_SERVER['HTTP_USER_AGENT'])) {
            // MS IE issue
            setcookie($cookie_name, "", time() + 3600, $cookie_domain);
        } elseif (eregi('Firefox', $_SERVER['HTTP_USER_AGENT'])) {
            setcookie($cookie_name, $COOKIE[$cookie_name], time() - 3600, $cookie_domain);
        } else {
Esempio n. 9
0
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();
Esempio n. 11
0
function find_best_location_in_include_path($path)
{
    $newpath = $path;
    $reltoinclude;
    if (substr($newpath, 0, 1) == "/" || substr($newpath, 0, 1) == "\\") {
        if (is_file($newpath) || is_dir($newpath)) {
            return $newpath;
        } else {
            return false;
        }
    }
    if (!is_file($newpath) && !is_dir($newpath)) {
        $found = find_file_to_include($newpath, $newpath, $reltoinclude);
        $newpath = get_relative_path(str_replace("/", "\\", realpath($newpath)), dirname(realpath($_SERVER["SCRIPT_FILENAME"])));
        if (!$found) {
            return false;
        }
    }
    return $newpath;
}
function find_best_location_in_include_path($path)
{
    $newpath = $path;
    $reltoinclude;
    //if ( !is_file ( $newpath ) && !is_dir ( $newpath ) )
    //{
    $found = find_file_to_include($newpath, $newpath, $reltoinclude);
    $newpath = get_relative_path(str_replace("/", "\\", realpath($newpath)), dirname(realpath($_SERVER["SCRIPT_FILENAME"])));
    if (!$found) {
        return false;
    }
    //}
    return $newpath;
}
}

// 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>
Esempio n. 14
0
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;
}
Esempio n. 15
0
            $b4plot->SetFillColor("#FBE32A");
            $b4plot->SetLegend('Lectures');
            $b5plot->SetColor("#000");
            $b5plot->SetFillColor("#000");
            $b5plot->SetLegend('Abandon');
            $graph->legend->SetColumns(5);
            $graph->legend->SetFrameWeight(2);
            $graph->legend->SetShadow();
            $graph->legend->Pos(0.5, 0.99, 'center', 'bottom');
            $graph->legend->SetLayout(LEGEND_HOR);
            $graph->Stroke($tmpfname);
            clean_old_tmp_files();
            ?>
                <article class="stats_graph">
                    <img src="<?php 
            echo get_relative_path($tmpfname);
            ?>
">
                </article>
                <?php 
            break;
        default:
        case 'ch':
            echo '<table class="tablesorter" cellspacing="0"> 
			    <thead> 
				    <tr> 
       					<th>Date</th> 
        				<th>Sujet</th> 
        				<th>Envois</th> 
        				<th>Lectures</th> 
        				<th>Ouvertures</th>
 function generate_url_params($target_format, $session_placeholder = false)
 {
     $this->apply_defaults();
     $result = "";
     $url = "";
     $url .= "title=" . $this->convert_special_chars($this->title_actual);
     $url .= "&xtitle=" . $this->convert_special_chars($this->xtitle_actual);
     $url .= "&ytitle=" . $this->convert_special_chars($this->ytitle_actual);
     if ($target_format == "PDF") {
         $url .= "&width=" . $this->width_pdf_actual;
         $url .= "&height=" . $this->height_pdf_actual;
     } else {
         $url .= "&width=" . $this->width_actual;
         $url .= "&height=" . $this->height_actual;
     }
     $url .= "&graphcolor=" . $this->graphcolor_actual;
     $url .= "&gridposition=" . $this->gridpos_actual;
     $url .= "&xgriddisplay=" . $this->xgriddisplay_actual;
     $url .= "&xgridcolor=" . $this->xgridcolor_actual;
     $url .= "&ygriddisplay=" . $this->ygriddisplay_actual;
     $url .= "&ygridcolor=" . $this->ygridcolor_actual;
     $url .= "&titlefont=" . $this->titlefont_actual;
     $url .= "&titlefontstyle=" . $this->titlefontstyle_actual;
     $url .= "&titlefontsize=" . $this->titlefontsize_actual;
     $url .= "&titlecolor=" . $this->titlecolor_actual;
     $url .= "&xaxiscolor=" . $this->xaxiscolor_actual;
     $url .= "&xaxisfont=" . $this->xaxisfont_actual;
     $url .= "&xaxisfontstyle=" . $this->xaxisfontstyle_actual;
     $url .= "&xaxisfontsize=" . $this->xaxisfontsize_actual;
     $url .= "&xaxisfontcolor=" . $this->xaxisfontcolor_actual;
     $url .= "&yaxiscolor=" . $this->yaxiscolor_actual;
     $url .= "&yaxisfont=" . $this->yaxisfont_actual;
     $url .= "&yaxisfontstyle=" . $this->yaxisfontstyle_actual;
     $url .= "&yaxisfontsize=" . $this->yaxisfontsize_actual;
     $url .= "&yaxisfontcolor=" . $this->yaxisfontcolor_actual;
     $url .= "&xtitlefont=" . $this->xtitlefont_actual;
     $url .= "&xtitlefontstyle=" . $this->xtitlefontstyle_actual;
     $url .= "&xtitlefontsize=" . $this->xtitlefontsize_actual;
     $url .= "&xtitlecolor=" . $this->xtitlecolor_actual;
     $url .= "&xtickint=" . $this->xtickinterval_actual;
     $url .= "&xticklabint=" . $this->xticklabelinterval_actual;
     $url .= "&ytitlefont=" . $this->ytitlefont_actual;
     $url .= "&ytitlefontstyle=" . $this->ytitlefontstyle_actual;
     $url .= "&ytitlefontsize=" . $this->ytitlefontsize_actual;
     $url .= "&ytitlecolor=" . $this->ytitlecolor_actual;
     $url .= "&ytickint=" . $this->ytickinterval_actual;
     $url .= "&yticklabint=" . $this->yticklabelinterval_actual;
     $url .= "&margincolor=" . $this->margincolor_actual;
     $url .= "&marginleft=" . $this->marginleft_actual;
     $url .= "&marginright=" . $this->marginright_actual;
     $url .= "&margintop=" . $this->margintop_actual;
     $url .= "&marginbottom=" . $this->marginbottom_actual;
     $url .= "&xlabels=" . implode(",", $this->xlabels);
     foreach ($this->plot as $k => $v) {
         $str = implode(",", $v["data"]);
         $url .= "&plotname{$k}=" . $v["name"];
         $url .= "&plotdata{$k}={$str}";
         $url .= "&plottype{$k}=" . $v["type"];
         $url .= "&plotlinecolor{$k}=" . $v["linecolor"];
         if ($v["legend"]) {
             $url .= "&plotlegend{$k}=" . $v["legend"];
         }
         if ($v["fillcolor"]) {
             $url .= "&plotfillcolor{$k}=" . $v["fillcolor"];
         }
     }
     if ($session_placeholder) {
         $ses = "graph_" . $session_placeholder;
         set_reportico_session_param($ses, $url);
         $url = "graphid=" . $ses . "&time=" . time();
     }
     // Select the appropriate reporting engine
     $dyngraph = "dyngraph.php";
     if (defined("SW_GRAPH_ENGINE") && SW_GRAPH_ENGINE == "PCHART") {
         $dyngraph = "dyngraph_pchart.php";
     }
     if (!is_file($dyngraph)) {
         find_file_to_include($dyngraph, $dyngraph);
         $dyngraph = get_relative_path(realpath($dyngraph), dirname($_SERVER["SCRIPT_FILENAME"]));
     }
     $dr = get_reportico_url_path();
     $result = '<img class="swRepGraph" src=\'' . $dr . $dyngraph . '?' . $url . '\'>';
     return $result;
 }
Esempio n. 17
0
function Interpret_IRB_to_HTML($IRB_array, $filename)
{
    // Create a string to receive the HTML
    $output_str = "";
    // Check if the Photoshop IRB array is valid
    if ($IRB_array !== FALSE) {
        // Create another string to receive secondary HTML to be appended at the end
        $secondary_output_str = "";
        // Add the Heading to the HTML
        $output_str .= "<h2 class=\"Photoshop_Main_Heading\">Contains Photoshop Information Resource Block (IRB)</h2>";
        // Add Table to the HTML
        $output_str .= "<table class=\"Photoshop_Table\" border=1>\n";
        // Cycle through each of the Photoshop IRB records, creating HTML for each
        foreach ($IRB_array as $IRB_Resource) {
            // Check if the entry is a known Photoshop IRB resource
            // Get the Name of the Resource
            if (array_key_exists($IRB_Resource['ResID'], $GLOBALS["Photoshop_ID_Names"])) {
                $Resource_Name = $GLOBALS['Photoshop_ID_Names'][$IRB_Resource['ResID']];
            } else {
                // Change: Added check for $GLOBALS['HIDE_UNKNOWN_TAGS'] to allow hiding of unknown resources as of 1.11
                if ($GLOBALS['HIDE_UNKNOWN_TAGS'] == TRUE) {
                    continue;
                } else {
                    // Unknown Resource - Make appropriate name
                    $Resource_Name = "Unknown Resource (" . $IRB_Resource['ResID'] . ")";
                }
            }
            // Add HTML for the resource as appropriate
            switch ($IRB_Resource['ResID']) {
                case 0x404:
                    // IPTC-NAA IIM Record
                    $secondary_output_str .= Interpret_IPTC_to_HTML(get_IPTC($IRB_Resource['ResData']));
                    break;
                case 0x40b:
                    // URL
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><a href=\"" . $IRB_Resource['ResData'] . "\">" . htmlentities($IRB_Resource['ResData']) . "</a></td></tr>\n";
                    break;
                case 0x40a:
                    // Copyright Marked
                    if (hexdec(bin2hex($IRB_Resource['ResData'])) == 1) {
                        $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>Image is Copyrighted Material</pre></td></tr>\n";
                    } else {
                        $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>Image is Not Copyrighted Material</pre></td></tr>\n";
                    }
                    break;
                case 0x40d:
                    // Global Lighting Angle
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>Global lighting angle for effects layer = " . hexdec(bin2hex($IRB_Resource['ResData'])) . " degrees</pre></td></tr>\n";
                    break;
                case 0x419:
                    // Global Altitude
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>Global Altitude = " . hexdec(bin2hex($IRB_Resource['ResData'])) . "</pre></td></tr>\n";
                    break;
                case 0x421:
                    // Version Info
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= "Version = " . hexdec(bin2hex(substr($IRB_Resource['ResData'], 0, 4))) . "\n";
                    $output_str .= "Has Real Merged Data = " . ord($IRB_Resource['ResData'][4]) . "\n";
                    $writer_size = hexdec(bin2hex(substr($IRB_Resource['ResData'], 5, 4))) * 2;
                    $output_str .= "Writer Name = " . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], 9, $writer_size), TRUE) . "\n";
                    $reader_size = hexdec(bin2hex(substr($IRB_Resource['ResData'], 9 + $writer_size, 4))) * 2;
                    $output_str .= "Reader Name = " . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], 13 + $writer_size, $reader_size), TRUE) . "\n";
                    $output_str .= "File Version = " . hexdec(bin2hex(substr($IRB_Resource['ResData'], 13 + $writer_size + $reader_size, 4))) . "\n";
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x411:
                    // ICC Untagged
                    if ($IRB_Resource['ResData'] == "") {
                        $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>Intentionally untagged - any assumed ICC profile handling disabled</pre></td></tr>\n";
                    } else {
                        $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>Unknown value (0x" . bin2hex($IRB_Resource['ResData']) . ")</pre></td></tr>\n";
                    }
                    break;
                case 0x41a:
                    // Slices
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\">";
                    // Unpack the first 24 bytes
                    $Slices_Info = unpack("NVersion/NBound_top/NBound_left/NBound_bottom/NBound_right/NStringlen", $IRB_Resource['ResData']);
                    $output_str .= "Version = " . $Slices_Info['Version'] . "<br>\n";
                    $output_str .= "Bounding Rectangle =  Top:" . $Slices_Info['Bound_top'] . ", Left:" . $Slices_Info['Bound_left'] . ", Bottom:" . $Slices_Info['Bound_bottom'] . ", Right:" . $Slices_Info['Bound_right'] . " (Pixels)<br>\n";
                    $Slicepos = 24;
                    // Extract a Unicode String
                    $output_str .= "Text = '" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], 24, $Slices_Info['Stringlen'] * 2), TRUE) . "'<br>\n";
                    $Slicepos += $Slices_Info['Stringlen'] * 2;
                    // Unpack the number of Slices
                    $Num_Slices = hexdec(bin2hex(substr($IRB_Resource['ResData'], $Slicepos, 4)));
                    $output_str .= "Number of Slices = " . $Num_Slices . "\n";
                    $Slicepos += 4;
                    // Cycle through the slices
                    for ($i = 1; $i <= $Num_Slices; $i++) {
                        $output_str .= "<br><br>Slice {$i}:<br>\n";
                        // Unpack the first 16 bytes of the slice
                        $SliceA = unpack("NID/NGroupID/NOrigin/NStringlen", substr($IRB_Resource['ResData'], $Slicepos));
                        $Slicepos += 16;
                        $output_str .= "ID = " . $SliceA['ID'] . "<br>\n";
                        $output_str .= "Group ID = " . $SliceA['GroupID'] . "<br>\n";
                        $output_str .= "Origin = " . $SliceA['Origin'] . "<br>\n";
                        // Extract a Unicode String
                        $output_str .= "Text = '" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], $Slicepos, $SliceA['Stringlen'] * 2), TRUE) . "'<br>\n";
                        $Slicepos += $SliceA['Stringlen'] * 2;
                        // Unpack the next 24 bytes of the slice
                        $SliceB = unpack("NType/NLeftPos/NTopPos/NRightPos/NBottomPos/NURLlen", substr($IRB_Resource['ResData'], $Slicepos));
                        $Slicepos += 24;
                        $output_str .= "Type = " . $SliceB['Type'] . "<br>\n";
                        $output_str .= "Position =  Top:" . $SliceB['TopPos'] . ", Left:" . $SliceB['LeftPos'] . ", Bottom:" . $SliceB['BottomPos'] . ", Right:" . $SliceB['RightPos'] . " (Pixels)<br>\n";
                        // Extract a Unicode String
                        $output_str .= "URL = <a href='" . substr($IRB_Resource['ResData'], $Slicepos, $SliceB['URLlen'] * 2) . "'>" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], $Slicepos, $SliceB['URLlen'] * 2), TRUE) . "</a><br>\n";
                        $Slicepos += $SliceB['URLlen'] * 2;
                        // Unpack the length of a Unicode String
                        $Targetlen = hexdec(bin2hex(substr($IRB_Resource['ResData'], $Slicepos, 4)));
                        $Slicepos += 4;
                        // Extract a Unicode String
                        $output_str .= "Target = '" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], $Slicepos, $Targetlen * 2), TRUE) . "'<br>\n";
                        $Slicepos += $Targetlen * 2;
                        // Unpack the length of a Unicode String
                        $Messagelen = hexdec(bin2hex(substr($IRB_Resource['ResData'], $Slicepos, 4)));
                        $Slicepos += 4;
                        // Extract a Unicode String
                        $output_str .= "Message = '" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], $Slicepos, $Messagelen * 2), TRUE) . "'<br>\n";
                        $Slicepos += $Messagelen * 2;
                        // Unpack the length of a Unicode String
                        $AltTaglen = hexdec(bin2hex(substr($IRB_Resource['ResData'], $Slicepos, 4)));
                        $Slicepos += 4;
                        // Extract a Unicode String
                        $output_str .= "Alt Tag = '" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], $Slicepos, $AltTaglen * 2), TRUE) . "'<br>\n";
                        $Slicepos += $AltTaglen * 2;
                        // Unpack the HTML flag
                        if (ord($IRB_Resource['ResData'][$Slicepos]) === 0x1) {
                            $output_str .= "Cell Text is HTML<br>\n";
                        } else {
                            $output_str .= "Cell Text is NOT HTML<br>\n";
                        }
                        $Slicepos++;
                        // Unpack the length of a Unicode String
                        $CellTextlen = hexdec(bin2hex(substr($IRB_Resource['ResData'], $Slicepos, 4)));
                        $Slicepos += 4;
                        // Extract a Unicode String
                        $output_str .= "Cell Text = '" . HTML_UTF16_Escape(substr($IRB_Resource['ResData'], $Slicepos, $CellTextlen * 2), TRUE) . "'<br>\n";
                        $Slicepos += $CellTextlen * 2;
                        // Unpack the last 12 bytes of the slice
                        $SliceC = unpack("NAlignH/NAlignV/CAlpha/CRed/CGreen/CBlue", substr($IRB_Resource['ResData'], $Slicepos));
                        $Slicepos += 12;
                        $output_str .= "Alignment =  Horizontal:" . $SliceC['AlignH'] . ", Vertical:" . $SliceC['AlignV'] . "<br>\n";
                        $output_str .= "Alpha Colour = " . $SliceC['Alpha'] . "<br>\n";
                        $output_str .= "Red = " . $SliceC['Red'] . "<br>\n";
                        $output_str .= "Green = " . $SliceC['Green'] . "<br>\n";
                        $output_str .= "Blue = " . $SliceC['Blue'] . "\n";
                    }
                    $output_str .= "</td></tr>\n";
                    break;
                case 0x408:
                    // Grid and Guides information
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\">";
                    // Unpack the Grids info
                    $Grid_Info = unpack("NVersion/NGridCycleH/NGridCycleV/NGuideCount", $IRB_Resource['ResData']);
                    $output_str .= "Version = " . $Grid_Info['Version'] . "<br>\n";
                    $output_str .= "Grid Cycle = " . $Grid_Info['GridCycleH'] / 32 . " Pixel(s)  x  " . $Grid_Info['GridCycleV'] / 32 . " Pixel(s)<br>\n";
                    $output_str .= "Number of Guides = " . $Grid_Info['GuideCount'] . "\n";
                    // Cycle through the Guides
                    for ($i = 0; $i < $Grid_Info['GuideCount']; $i++) {
                        // Unpack the info for this guide
                        $Guide_Info = unpack("NLocation/CDirection", substr($IRB_Resource['ResData'], 16 + $i * 5, 5));
                        $output_str .= "<br>Guide {$i} : Location = " . $Guide_Info['Location'] / 32 . " Pixel(s) from edge";
                        if ($Guide_Info['Direction'] === 0) {
                            $output_str .= ", Vertical\n";
                        } else {
                            $output_str .= ", Horizontal\n";
                        }
                    }
                    break;
                    $output_str .= "</td></tr>\n";
                case 0x406:
                    // JPEG Quality
                    $Qual_Info = unpack("nQuality/nFormat/nScans/Cconst", $IRB_Resource['ResData']);
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\">";
                    switch ($Qual_Info['Quality']) {
                        case 0xfffd:
                            $output_str .= "Quality 1 (Low)<br>\n";
                            break;
                        case 0xfffe:
                            $output_str .= "Quality 2 (Low)<br>\n";
                            break;
                        case 0xffff:
                            $output_str .= "Quality 3 (Low)<br>\n";
                            break;
                        case 0x0:
                            $output_str .= "Quality 4 (Low)<br>\n";
                            break;
                        case 0x1:
                            $output_str .= "Quality 5 (Medium)<br>\n";
                            break;
                        case 0x2:
                            $output_str .= "Quality 6 (Medium)<br>\n";
                            break;
                        case 0x3:
                            $output_str .= "Quality 7 (Medium)<br>\n";
                            break;
                        case 0x4:
                            $output_str .= "Quality 8 (High)<br>\n";
                            break;
                        case 0x5:
                            $output_str .= "Quality 9 (High)<br>\n";
                            break;
                        case 0x6:
                            $output_str .= "Quality 10 (Maximum)<br>\n";
                            break;
                        case 0x7:
                            $output_str .= "Quality 11 (Maximum)<br>\n";
                            break;
                        case 0x8:
                            $output_str .= "Quality 12 (Maximum)<br>\n";
                            break;
                        default:
                            $output_str .= "Unknown Quality (" . $Qual_Info['Quality'] . ")<br>\n";
                            break;
                    }
                    switch ($Qual_Info['Format']) {
                        case 0x0:
                            $output_str .= "Standard Format\n";
                            break;
                        case 0x1:
                            $output_str .= "Optimised Format\n";
                            break;
                        case 0x101:
                            $output_str .= "Progressive Format<br>\n";
                            break;
                        default:
                            $output_str .= "Unknown Format (" . $Qual_Info['Format'] . ")\n";
                            break;
                    }
                    if ($Qual_Info['Format'] == 0x101) {
                        switch ($Qual_Info['Scans']) {
                            case 0x1:
                                $output_str .= "3 Scans\n";
                                break;
                            case 0x2:
                                $output_str .= "4 Scans\n";
                                break;
                            case 0x3:
                                $output_str .= "5 Scans\n";
                                break;
                            default:
                                $output_str .= "Unknown number of scans (" . $Qual_Info['Scans'] . ")\n";
                                break;
                        }
                    }
                    $output_str .= "</td></tr>\n";
                    break;
                case 0x409:
                    // Thumbnail Resource
                // Thumbnail Resource
                case 0x40c:
                    // Thumbnail Resource
                    $thumb_data = unpack("NFormat/NWidth/NHeight/NWidthBytes/NSize/NCompressedSize/nBitsPixel/nPlanes", $IRB_Resource['ResData']);
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= "Format = " . ($thumb_data['Format'] == 1 ? "JPEG RGB\n" : "Raw RGB\n");
                    $output_str .= "Width = " . $thumb_data['Width'] . "\n";
                    $output_str .= "Height = " . $thumb_data['Height'] . "\n";
                    $output_str .= "Padded Row Bytes = " . $thumb_data['WidthBytes'] . " bytes\n";
                    $output_str .= "Total Size = " . $thumb_data['Size'] . " bytes\n";
                    $output_str .= "Compressed Size = " . $thumb_data['CompressedSize'] . " bytes\n";
                    $output_str .= "Bits per Pixel = " . $thumb_data['BitsPixel'] . " bits\n";
                    $output_str .= "Number of planes = " . $thumb_data['Planes'] . " bytes\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_ps_thumb.php", getcwd());
                    $link_str .= "?filename=";
                    $link_str .= get_relative_path($filename, dirname(__FILE__));
                    // Add thumbnail link to html
                    $output_str .= "Thumbnail Data:</pre><a class=\"Photoshop_Thumbnail_Link\" href=\"{$link_str}\"><img class=\"Photoshop_Thumbnail_Link\" src=\"{$link_str}\"></a>\n";
                    $output_str .= "</td></tr>\n";
                    break;
                case 0x414:
                    // Document Specific ID's
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>" . hexdec(bin2hex($IRB_Resource['ResData'])) . "</pre></td></tr>\n";
                    break;
                case 0x41e:
                    // URL List
                    $URL_count = hexdec(bin2hex(substr($IRB_Resource['ResData'], 0, 4)));
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\">\n";
                    $output_str .= "{$URL_count} URL's in list<br>\n";
                    $urlstr = substr($IRB_Resource['ResData'], 4);
                    // TODO: Check if URL List in Photoshop IRB works
                    for ($i = 0; $i < $URL_count; $i++) {
                        $url_data = unpack("NLong/NID/NURLSize", $urlstr);
                        $output_str .= "URL {$i} info: long = " . $url_data['Long'] . ", ";
                        $output_str .= "ID = " . $url_data['ID'] . ", ";
                        $urlstr = substr($urlstr, 12);
                        $url = substr($urlstr, 0, $url_data['URLSize']);
                        $output_str .= "URL = <a href=\"" . xml_UTF16_clean($url, TRUE) . "\">" . HTML_UTF16_Escape($url, TRUE) . "</a><br>\n";
                    }
                    $output_str .= "</td></tr>\n";
                    break;
                case 0x3f4:
                    // Grayscale and multichannel halftoning information.
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= Interpret_Halftone($IRB_Resource['ResData']);
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x3f5:
                    // Color halftoning information
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= "Cyan Halftoning Info:\n" . Interpret_Halftone(substr($IRB_Resource['ResData'], 0, 18)) . "\n\n";
                    $output_str .= "Magenta Halftoning Info:\n" . Interpret_Halftone(substr($IRB_Resource['ResData'], 18, 18)) . "\n\n";
                    $output_str .= "Yellow Halftoning Info:\n" . Interpret_Halftone(substr($IRB_Resource['ResData'], 36, 18)) . "\n";
                    $output_str .= "Black Halftoning Info:\n" . Interpret_Halftone(substr($IRB_Resource['ResData'], 54, 18)) . "\n";
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x3f7:
                    // Grayscale and multichannel transfer function.
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= Interpret_Transfer_Function(substr($IRB_Resource['ResData'], 0, 28));
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x3f8:
                    // Color transfer functions
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= "Red Transfer Function:   \n" . Interpret_Transfer_Function(substr($IRB_Resource['ResData'], 0, 28)) . "\n\n";
                    $output_str .= "Green Transfer Function: \n" . Interpret_Transfer_Function(substr($IRB_Resource['ResData'], 28, 28)) . "\n\n";
                    $output_str .= "Blue Transfer Function:  \n" . Interpret_Transfer_Function(substr($IRB_Resource['ResData'], 56, 28)) . "\n";
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x3f3:
                    // Print Flags
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    if ($IRB_Resource['ResData'][0] == "") {
                        $output_str .= "Labels Selected\n";
                    } else {
                        $output_str .= "Labels Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][1] == "") {
                        $output_str .= "Crop Marks Selected\n";
                    } else {
                        $output_str .= "Crop Marks Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][2] == "") {
                        $output_str .= "Color Bars Selected\n";
                    } else {
                        $output_str .= "Color Bars Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][3] == "") {
                        $output_str .= "Registration Marks Selected\n";
                    } else {
                        $output_str .= "Registration Marks Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][4] == "") {
                        $output_str .= "Negative Selected\n";
                    } else {
                        $output_str .= "Negative Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][5] == "") {
                        $output_str .= "Flip Selected\n";
                    } else {
                        $output_str .= "Flip Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][6] == "") {
                        $output_str .= "Interpolate Selected\n";
                    } else {
                        $output_str .= "Interpolate Not Selected\n";
                    }
                    if ($IRB_Resource['ResData'][7] == "") {
                        $output_str .= "Caption Selected";
                    } else {
                        $output_str .= "Caption Not Selected";
                    }
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x2710:
                    // Print Flags Information
                    $PrintFlags = unpack("nVersion/CCentCrop/Cjunk/NBleedWidth/nBleedWidthScale", $IRB_Resource['ResData']);
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= "Version = " . $PrintFlags['Version'] . "\n";
                    $output_str .= "Centre Crop Marks = " . $PrintFlags['CentCrop'] . "\n";
                    $output_str .= "Bleed Width = " . $PrintFlags['BleedWidth'] . "\n";
                    $output_str .= "Bleed Width Scale = " . $PrintFlags['BleedWidthScale'];
                    $output_str .= "</pre></td></tr>\n";
                    break;
                case 0x3ed:
                    // Resolution Info
                    $ResInfo = unpack("nhRes_int/nhResdec/nhResUnit/nwidthUnit/nvRes_int/nvResdec/nvResUnit/nheightUnit", $IRB_Resource['ResData']);
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\"><pre>\n";
                    $output_str .= "Horizontal Resolution = " . ($ResInfo['hRes_int'] + $ResInfo['hResdec'] / 65536) . " pixels per Inch\n";
                    $output_str .= "Vertical Resolution = " . ($ResInfo['vRes_int'] + $ResInfo['vResdec'] / 65536) . " pixels per Inch\n";
                    if ($ResInfo['hResUnit'] == 1) {
                        $output_str .= "Display units for Horizontal Resolution = Pixels per Inch\n";
                    } elseif ($ResInfo['hResUnit'] == 2) {
                        $output_str .= "Display units for Horizontal Resolution = Pixels per Centimetre\n";
                    } else {
                        $output_str .= "Display units for Horizontal Resolution = Unknown Value (" . $ResInfo['hResUnit'] . ")\n";
                    }
                    if ($ResInfo['vResUnit'] == 1) {
                        $output_str .= "Display units for Vertical Resolution = Pixels per Inch\n";
                    } elseif ($ResInfo['vResUnit'] == 2) {
                        $output_str .= "Display units for Vertical Resolution = Pixels per Centimetre\n";
                    } else {
                        $output_str .= "Display units for Vertical Resolution = Unknown Value (" . $ResInfo['vResUnit'] . ")\n";
                    }
                    if ($ResInfo['widthUnit'] == 1) {
                        $output_str .= "Display units for Image Width = Inches\n";
                    } elseif ($ResInfo['widthUnit'] == 2) {
                        $output_str .= "Display units for Image Width = Centimetres\n";
                    } elseif ($ResInfo['widthUnit'] == 3) {
                        $output_str .= "Display units for Image Width = Points\n";
                    } elseif ($ResInfo['widthUnit'] == 4) {
                        $output_str .= "Display units for Image Width = Picas\n";
                    } elseif ($ResInfo['widthUnit'] == 5) {
                        $output_str .= "Display units for Image Width = Columns\n";
                    } else {
                        $output_str .= "Display units for Image Width = Unknown Value (" . $ResInfo['widthUnit'] . ")\n";
                    }
                    if ($ResInfo['heightUnit'] == 1) {
                        $output_str .= "Display units for Image Height = Inches";
                    } elseif ($ResInfo['heightUnit'] == 2) {
                        $output_str .= "Display units for Image Height = Centimetres";
                    } elseif ($ResInfo['heightUnit'] == 3) {
                        $output_str .= "Display units for Image Height = Points";
                    } elseif ($ResInfo['heightUnit'] == 4) {
                        $output_str .= "Display units for Image Height = Picas";
                    } elseif ($ResInfo['heightUnit'] == 5) {
                        $output_str .= "Display units for Image Height = Columns";
                    } else {
                        $output_str .= "Display units for Image Height = Unknown Value (" . $ResInfo['heightUnit'] . ")";
                    }
                    $output_str .= "</pre></td></tr>\n";
                    break;
                default:
                    // All other records
                    $output_str .= "<tr class=\"Photoshop_Table_Row\"><td class=\"Photoshop_Caption_Cell\">{$Resource_Name}</td><td class=\"Photoshop_Value_Cell\">RESOURCE DECODING NOT IMPLEMENTED YET<BR>" . strlen($IRB_Resource['ResData']) . " bytes</td></tr>\n";
            }
        }
        // Add the table end to the HTML
        $output_str .= "</table>\n";
        // Add any secondary output to the HTML
        $output_str .= $secondary_output_str;
    }
    // Return the HTML
    return $output_str;
}
Esempio n. 18
0
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;
}
 /**
  * Get dump url
  *
  * @param string $page pagename
  * @param string $source source path used to compute relative path
  * @return string 
  */
 function get_dump_url($page, $source)
 {
     if (is_callable('get_autoaliases')) {
         // support lower versions
         $real = get_autoaliases($page);
         if (is_array($real)) {
             // plus
             if (count($real) === 1) {
                 $page = $real[0];
             } elseif (count($real) >= 2) {
                 // can not replace url to html address
                 return null;
             }
         } elseif (is_string($real)) {
             // org or old plus
             if ($real !== '') {
                 $page = $real;
             }
         }
     }
     if ($page == $GLOBALS['defaultpage']) {
         $url = $this->CONF['TOPURL'];
     } else {
         $filename = $this->get_dump_filename($page);
         switch ($this->CONF['href_urlstyle']) {
             case 'absolute':
                 $url = $this->CONF['TOPURL'] . $filename;
                 break;
             case 'relative':
                 $url = $filename;
                 $url = get_relative_path($source, $url);
             default:
                 break;
         }
     }
     return $url;
 }