示例#1
0
    addGeoToCanvas($canvas, $geo, $bustCache);
}
timestamp('post geos');
// Display canvas as png image when php page is requested.
if (!$metrics) {
    header("Content-Type: image/" . IMGFMT);
    echo $canvas;
}
// Generate thumbnail image of the title for UI purposes.
$thumb = $canvas->clone();
if ($player) {
    $thumb->cropImage(427, 240, 350, 795);
    $thumb->resizeImage(72, 40, Imagick::FILTER_TRIANGLE, 1);
    $thumb->writeImage(realpath('thumbs') . '/' . $filename . '.' . IMGFMT);
    // headshotless title generation for animation
    $noHeadshot = getStatscard($player, ["emptyHeadshot" => true]);
    $noHeadshotCanvas = new Imagick();
    $noHeadshotCanvas->newImage(1920, 1080, "none", IMGFMT);
    $noHeadshotCanvas->setImageDepth(8);
    $noHeadshotCanvas->setimagecolorspace(imagick::COLORSPACE_SRGB);
    foreach ($noHeadshot['geos'] as $geo) {
        addGeoToCanvas($noHeadshotCanvas, $geo, $bustCache);
    }
    $noHeadshotCanvas->writeImage(realpath('out') . '/' . $filename . '_noHeadshot.' . IMGFMT);
} else {
    //$thumb->cropImage(1440, 1080, 0, 0);
    $thumb->resizeImage(72, 40, Imagick::FILTER_TRIANGLE, 1);
    $thumb->writeImage(realpath('thumbs') . '/' . $filename . '.' . IMGFMT);
}
timestamp('post thumbs');
// Generate the output file of the title.
示例#2
0
文件: putter.php 项目: rpitv/rpits
    }
    $response = @stream_get_contents($fp);
    if ($response === false) {
        //throw new Exception("Problem reading data from $url, $php_errormsg <br>");
    }
    return $response;
}
$path = $_GET["path"];
$command = $_GET["command"];
$server = $_GET["server"];
$method = "POST";
$data = "";
if ($server == 'animator') {
    $method = "PUT";
    if ($_GET["type"] && $_GET["type"] == 'player') {
        $title = getStatscard($_GET["id"]);
        $data = getAnimationScriptForTitle($title);
        $command = 'script';
        $log .= "Animator Script: " . $_GET['type'] . ' ' . $_GET['id'];
    } else {
        if ($_GET["type"]) {
            http_response_code(400);
            die('Title type not supported for animation');
        } else {
            $data = $command;
            $command = 'command';
            // does this make sense? OH WELL
            $log .= "Animator Command: {$data}, ";
        }
    }
} else {