Beispiel #1
0
function resizeimage($image, $config_name)
{
    switch ($config_name) {
        case 'signature':
            $image_data = SIGGEN_DIR . 'save/remp.png';
            $image_data_save = SIGGEN_DIR . 'save/temp.png';
            break;
        case 'avatar':
            $image_data = SIGGEN_DIR . 'save/crop-av.png';
            $image_data_save = SIGGEN_DIR . 'save/temp-av.png';
            break;
        default:
            $image_data = SIGGEN_DIR . 'save/remp.png';
            break;
    }
    if (is_file($image_data) || is_link($image_data)) {
        unlink($image_data);
    }
    //unlink($image_data);
    //$image_data_save = SIGGEN_DIR.'save/temp.png';
    // Set our crop dimensions.
    $width = 210;
    $height = 120;
    // Get dimensions of existing image
    $dimensions = getimagesize($image);
    // Prepare image resizing and crop -- Center crop location
    $newwidth = $dimensions[0];
    $newheight = $dimensions[1];
    $im_dest = imagecreatefrompng($image_data_save);
    //imagecreatetruecolor ($width, $height);
    //imagealphablending($im_dest, false);
    combineImage($im_dest, $image, __LINE__, 0, 0);
    $im_temp = @imagecreatefrompng($image_data_save);
    $im_temp_width = imageSX($im_temp);
    $im_temp_height = imageSY($im_temp);
    //@imagecopy( $im_dest,$im_temp,0,0,0,0,$im_temp_width,$im_temp_height );
    //imagecopyresampled($im_dest, $im, 0, 0, 0, 0, $width, $height, $newwidth, $newheight);
    imagesavealpha($im_dest, true);
    //$imagenew =
    //ob_start();
    imagepng($im_dest, $image_data);
    //$image_data = ob_get_contents();
    //ob_end_clean();
    return $image_data;
}
Beispiel #2
0
        if (file_exists($im_class_file)) {
            combineImage($im, $im_class_file, __LINE__, $configData['class_img_loc_x'], $configData['class_img_loc_y']);
        }
    }
    // Place Spec image
    if ($o == 'spec' && $configData['spec_img_disp'] && !empty($sig_spec_img)) {
        $im_spec_file = $configData['image_dir'] . $configData['spec_dir'] . $sig_spec_img;
        if (file_exists($im_spec_file)) {
            combineImage($im, $im_spec_file, __LINE__, $configData['spec_img_loc_x'], $configData['spec_img_loc_y']);
        }
    }
    // Place the level bubble
    if ($o == 'lvl' && $configData['lvl_disp']) {
        $im_lvl_file = $configData['image_dir'] . $configData['level_dir'] . $configData['lvl_image'];
        if (!empty($configData['lvl_image']) && file_exists($im_lvl_file)) {
            combineImage($im, $im_lvl_file, __LINE__, $configData['lvl_loc_x'], $configData['lvl_loc_y']);
        }
        // Get the text locations based on the image location
        $lvl_text_loc_x = $configData['lvl_text_loc_x'] + $configData['lvl_loc_x'];
        $lvl_text_loc_y = $configData['lvl_text_loc_y'] + $configData['lvl_loc_y'];
        // Print the level as text
        writeText($im, $configData['lvl_font_size'], $lvl_text_loc_x, $lvl_text_loc_y, $configData['lvl_font_color'], $configData['lvl_font_name'], $sig_level, 'center', $configData['lvl_text_shadow']);
    }
}
#--[ EXP BAR PLACEMENT ]---------------------------------------------------
if ($configData['expbar_disp'] && !empty($sig_exp)) {
    // Get the end locations for the eXp bar
    $x_end = $configData['expbar_loc_x'] + $configData['expbar_length'];
    $y_end = $configData['expbar_loc_y'] + $configData['expbar_height'];
    // Draw a full eXP bar
    if ($sig_level == $configData['expbar_max_level'] && $configData['expbar_max_disp'] && !$configData['expbar_max_hidden']) {