예제 #1
0
파일: functions.php 프로젝트: h3len/Project
function hg_turn_img($file_path, $save_file_path, $direction)
{
    include_once ROOT_PATH . 'lib/class/gdimage.php';
    $angle = '';
    switch ($direction) {
        case 1:
            //左旋转
            $angle = '90';
            break;
        case 2:
            //右旋转
            $angle = '-90';
            break;
        case 3:
            //180度 掉头
            $angle = '180';
            break;
        default:
            return false;
            break;
    }
    $img = new GDImage();
    $img->init_setting($file_path, $save_file_path, '', $angle);
    $img->turnImg();
    return true;
}