Example #1
0
if ($deer_info['status'] != 'found') {
    header('HTTP/1.1 404 Deer Not Found');
    die('Deer not found!');
}
$modifiers = isset($_GET['modifiers']) && $_GET['modifiers'] != '' ? str_split(preg_replace("/[^a-z]/i", '', $_GET['modifiers'])) : array();
sort($modifiers);
$modifiers = implode(array_unique($modifiers));
$sizemultiplier = strpos($modifiers, 'h') !== false ? 3 : 1;
$cellspacing = strpos($modifiers, 'c') !== false ? 2 : 0;
$lonely_secluded = strpos($modifiers, 'a') !== false ? 10 : 1;
if (strlen($modifiers) > 0) {
    $kins = $deer->apply_modifiers($kins, $modifiers);
}
$kins = explode(PHP_EOL, $kins);
$deer_file = $image_dir . $deer_info['deer'] . '__' . $modifiers . '.' . $output;
$mem = array('height' => $deer->get_height($kins), 'width' => $deer->get_width($kins));
$height = ($mem['height'] * $col['height'] + ($mem['height'] * $cellspacing - $cellspacing)) * $lonely_secluded * $sizemultiplier;
$width = ($mem['width'] * $col['width'] + ($mem['width'] * $cellspacing - $cellspacing)) * $lonely_secluded * $sizemultiplier;
$rectangles = '';
$allocated = array();
$y = 0;
switch ($output) {
    case 'jpg':
    case 'jpeg':
    case 'png':
        $img = @imagecreate($width, $height);
        $bg = imagecolorallocate($img, 255, 255, 255);
        break;
    default:
}
foreach ($kins as $deer_line) {