示例#1
0
 private function outputImg()
 {
     if (imagetypes() & IMG_PNG) {
         header('Content-type:image/png');
         imagejpeg($this->im);
     } elseif (imagetypes() & IMG_GIF) {
         header('Content-type: image/gif');
         imagegif($this->im);
     } elseif (imagetype() & IMG_JPG) {
         header('Content-type: image/jpeg');
         imagepng($this->im);
     } else {
         die("Don't support image type!");
     }
 }
示例#2
0
    function imgThumb($pathArquivo, $nomeArquivo, $width, $height, $title = "", $link = "", $rel = "", $mini = "mini_", $centerH = false, $centerV = false, $target = "") {
        global $pathSite;
        $fileType = imagetype($pathArquivo . $nomeArquivo);

        if ($fileType) {
            if ($fileType == "image") {
                if ($link) {
                    ?>
                    <a href="<?php 
echo $link;
?>
" rel="<?php 
echo $rel;
?>
" target="<?php 
echo $target;
?>
">
                <?
                }
                ?>
                <img alt="<?php 
echo $title;
?>
" title="<?php 
echo $title;
?>
" src="<?php 
echo $pathArquivo;
echo $mini ? $mini : "";
echo $nomeArquivo;
?>
" <?php 
echo !strstr($width, "%") ? "onload='resizeToRatio(this, {$width}, {$height}, " . (int) $centerH . ", " . (int) $centerV . ")'" : "width='{$width}'";
?>
/>
                <?
                if ($link) {
                    ?>
                    </a>
                <?
                }
            } elseif ($fileType == "swf") {
                $test = getimagesize($pathArquivo . $nomeArquivo);
                $widthArquivo = $test[0];
                $heightArquivo = $test[1];
                if ($widthArquivo >= $heightArquivo) {
                    $ratio = $widthArquivo / $heightArquivo;
                    $height = $width / $ratio;
                } else {
                    $ratio = $heightArquivo / $widthArquivo;
                    $width = $height / $ratio;
                }
                ?>
                <object type="application/x-shockwave-flash" data="<?php 
echo $pathArquivo . $nomeArquivo;
?>
" width="100%" height="100%">
                    <param name="movie" value="<?php 
echo $pathArquivo . $nomeArquivo;
?>
" />
                    <param name="quality" value="high"/>
                    <param name="wmode" value="transparent"/>
                </object>
            <?
            }
        } else {
            if ($link) {
                ?>
                <a href="<?php 
echo $link;
?>
" rel="<?php 
echo $rel;
?>
" target="<?php 
echo $target;
?>
">
            <?
            }
            ?>
            <img alt="<?php 
echo $title;
?>
" title="<?php 
echo $title;
?>
" src="<?php 
echo $pathSite;
?>
imagens/semFoto.png" <?php 
echo !strstr($width, "%") ? "onload='resizeToRatio(this, {$width}, {$height}, " . (int) $centerH . ", " . (int) $centerV . ")'" : "width='{$width}'";
?>
/>
            <?
            if ($link) {
                ?>
                </a>
            <?
            }
        }
    }
示例#3
0
<?php

require_once "./init.php";
if (!defined('is_florensia')) {
    die('Hacking attempt');
}
if (!$mybb->user['uid']) {
    $florensia->output_page($flouser->noaccess());
}
$flolang->load("signature");
$sep = "-";
$createfile = $cfg['signature_abs'] . "/create/" . $mybb->user['uid'];
if (isset($_POST['layerupload']) && is_file($_FILES['sigupload']['tmp_name'])) {
    $upload = false;
    $sigpic = $_FILES['sigupload']['tmp_name'];
    if (imagetype($sigpic, 700, 700)) {
        if (copy($_FILES['sigupload']['tmp_name'], $createfile)) {
            chmod($createfile, 0755);
            $upload = true;
        }
    }
    if (!$upload) {
        $florensia->notice($flolang->signature_create_backgroundupload_error_notice, "warning");
    }
}
if ($template = MYSQL_FETCH_ARRAY(MYSQL_QUERY("SELECT template,characters FROM flobase_signaturetemp WHERE userid='" . $mybb->user['uid'] . "'"))) {
    $template_exists = true;
}
if (isset($_POST['layerupload']) or isset($_POST['refresh'])) {
    if (simplexml_load_string($_POST['signaturetemplate'], 'SimpleXMLElement', LIBXML_NOWARNING)) {
        if ($template_exists) {
示例#4
0
if (isset($_SESSION["debug"])) {
    $debug = $_SESSION["debug"];
}
$lastpage = "picture_load_file.php";
$nextpage = "picture_rotage.php";
//Test if Session is valid ($step)
test_session(1);
$max_width = $_SESSION["settings"]["show_picture_max_width"];
$max_height = $_SESSION["settings"]["show_picture_max_height"];
$error = 1;
//zunächst wird von einem Fehler ausgegangen, wenn Upload OK-> $error=0;
//Teste ob eine Datei hochgeladen wurde
if (isset($_FILES["file"]["error"]) and isset($_FILES["file"]["name"])) {
    if ($_FILES["file"]["error"] == 0) {
        //Teste Dateiendung
        $imgtype = imagetype($_FILES["file"]["name"]);
        if ($imgtype != "UNKNOWN") {
            $_SESSION["image_type"] = $imgtype;
            $filename = $_SESSION["temp_image_file_path"] . ".{$imgtype}";
            $_SESSION["image_temp_filename"] = $filename;
            $_SESSION["image_temp_modified_filename"] = $_SESSION["temp_image_file_path"] . ".modified.{$imgtype}";
            //Kopiere Datei
            if (move_uploaded_file($_FILES["file"]["tmp_name"], $_SESSION["image_temp_filename"])) {
                $msg = "Datei ist valide und wurde erfolgreich hochgeladen.\n";
                //Zoomfaktor für Anzeige bestimmen
                $retval = getzoomfactor($filename, $max_width, $max_height, $debug);
                $_SESSION["zoom_factor"] = $retval["zoom_factor"];
                $_SESSION["image_width_org"] = $retval["image_width_org"];
                $_SESSION["image_height_org"] = $retval["image_height_org"];
                $_SESSION["image_width_show"] = $retval["image_width_new"];
                $_SESSION["image_height_show"] = $retval["image_height_new"];
示例#5
0
文件: functions.php 项目: reimht/lisa
function getDir($dir, $dirname, $target)
{
    if (is_dir($dir)) {
        $directory = opendir($dir);
        while ($file = readdir($directory)) {
            if ($file != "." && $file != ".." && $file != "small") {
                if (is_dir("{$dir}/{$file}")) {
                    getDir("{$dir}/{$file}", $file, $target);
                } else {
                    if (imagetype($file) != "UNKNOWN" && $dirname != "small" && $dirname != "MAINDIRECTORY") {
                        $createTime = filemtime("{$dir}/{$file}");
                        filename2student($dirname, $file, $target, $createTime);
                    }
                }
            }
        }
        closedir($directory);
    }
}
示例#6
0
    $debug = $_SESSION["debug"];
}
$settings = $_SESSION["settings"];
$lastpage = "picture_load_from_server.php";
$nextpage = "picture_crop.php";
//Test if Session is valid ($step)
test_session(1);
$picfile = "";
$msg = "";
$error_msg = "";
if (isset($_GET["picfile"])) {
    $picfile = $_SESSION["lisa_path"] . "/" . $_GET["picfile"];
    $picfile = str_replace("//", "/", str_replace("//", "/", $picfile));
    //Etwas unsauber. Falls mehrere VERZEICHNISTRENNER
    if (file_exists($picfile)) {
        $imgtype = imagetype($picfile);
        if ($imgtype != "UNKNOWN") {
            $_SESSION["image_type"] = $imgtype;
            $filename_new = $_SESSION["temp_image_file_path"] . ".{$imgtype}";
            $_SESSION["image_temp_filename"] = $filename_new;
            $_SESSION["image_temp_modified_filename"] = $_SESSION["temp_image_file_path"] . ".modified.{$imgtype}";
            if (@copy($picfile, $filename_new)) {
                //Bilddaten wie Auflösung und notwengigen Zoomfaktor bestimmen
                $max_width = $settings["show_picture_max_width"];
                $max_height = $settings["show_picture_max_height"];
                $retval = getzoomfactor($filename_new, $max_width, $max_height, $debug);
                if ($retval["error"] == 0) {
                    $_SESSION["zoom_factor"] = $retval["zoom_factor"];
                    $_SESSION["image_width_org"] = $retval["image_width_org"];
                    $_SESSION["image_height_org"] = $retval["image_height_org"];
                    $_SESSION["image_width_show"] = $retval["image_width_new"];
示例#7
0
 public function outImg()
 {
     ob_start();
     ob_clean();
     if (imagetypes() & IMG_JPG) {
         header('Content-type:image/jpeg');
         imagejpeg($this->img);
     } elseif (imagetypes() & IMG_GIF) {
         header('Content-type: image/gif');
         imagegif($this->img);
     } elseif (imagetype() & IMG_PNG) {
         header('Content-type: image/png');
         imagepng($this->img);
     } else {
         die("Don't support image type!");
     }
     imagedestroy($this->img);
 }