Beispiel #1
0
// $session = $_SESSION;
print_r($post);
//	print_r($session);
// die();
if ($post['conf_type'] === 'bar') {
    // $base = new \Imagick();
    // if(isset($post['layer_top']) && $post['layer_top'] != "")
    // $layout = new \Imagick('/var/www/mch/'.$post['layer_top']);
    $bar_values = array('base' => $base, 'layer_top' => $layer_top, 'layer_top_x' => $layer_top_x, 'layer_top_y' => $layer_top_y, 'line_1' => $line_one, 'line_2' => $line_two, 'line_3' => $line_three, 'line_4' => $line_four, 'line_1_font' => $line_one_font, 'line_2_font' => $line_two_font, 'line_3_font' => $line_three_font, 'line_4_font' => $line_four_font, 'line_1_size' => $line_one_size, 'line_2_size' => $line_two_size, 'line_3_size' => $line_three_size, 'line_4_size' => $line_four_size, 'line_1_x' => $line_1_x, 'line_2_x' => $line_2_x, 'line_3_x' => $line_3_x, 'line_4_x' => $line_4_x, 'line_1_y' => $line_1_y, 'line_2_y' => $line_2_y, 'line_3_y' => $line_3_y, 'line_4_y' => $line_4_y, 'image_uploaded' => $image_uploaded);
    $ext = "." . trim(pathinfo($a['base'], PATHINFO_EXTENSION));
    $filename_bar = basename($a['base'], $ext);
    if ($filename_bar === 'combo-1-75' || $filename_bar === 'dark-1-75' || $filename_bar === 'milk-1-75') {
        $barpath = tinyBar($a);
    }
    if ($filename_bar === 'combo-14-8' || $filename_bar === 'dark-14-8' || $filename_bar === 'milk-14-8') {
        $barpath = smallBar($a);
    }
    if ($filename_bar === 'combo-5-2' || $filename_bar === 'dark-5-2' || $filename_bar === 'milk-5-2') {
        $barpath = mediumBar($a);
    }
    if ($filename_bar === 'combo-4-6' || $filename_bar === 'dark-4-6' || $filename_bar === 'milk-4-6') {
        $barpath = largeBar($a);
    }
    if ($filename_bar === 'combo-9-5-8' || $filename_bar === 'dark-9-5-8' || $filename_bar === 'milk-9-5-8') {
        $barpath = kingBar($a);
    }
    // $img = '/var/www/mch'.$post['base'];
    // $size = getimagesize($img);
    // $h = ($size[0])/3;
    // $w = ($size[1])/3;
    // $h = 100;
    }
    $bar = $base->writeImage('/var/www/mch/public/test_bar.png');
    $base->destroy();
    if ($bar) {
        $barpath = "test_bar.png";
        // echo "x-axis : ".$x." y-axis : ".$y;
        echo "<img src='{$barpath}'>";
        return $bar;
    } else {
        return false;
    }
}
// echo $post['layer_top_x']." ";
// echo $post['layer_top_y']." ";
//tinyBar($a); //1-75
smallBar($a);
//14-8
// mediumBar($a); //5-2
// largeBar($a); //4-6
//kingBar($a); //9-5-8
$ext = "." . trim(pathinfo($a['base'], PATHINFO_EXTENSION));
echo basename($a['base'], $ext);
function convert($imgdir)
{
    ob_start();
    list($width, $height) = getimagesize($imgdir);
    $new_width = $width;
    $new_height = $height;
    // Resample
    $image_p = imagecreatetruecolor($new_width, $new_height);
    $ext = trim(pathinfo($imgdir, PATHINFO_EXTENSION));