예제 #1
0
    // lcd = '1 or 2 or 3 (176, 240, 320)'
    $lcd = $_GET['lcd'];
    $widths = array();
    $heights = array();
    $arr = explode(':', $dim);
    if (count($arr) == 0) {
        // error
        $message = "Missing parameters(dimension)";
        $result = -9;
    } else {
        $i = 0;
        foreach ($arr as $sizes) {
            $x = explode('x', $sizes);
            if (count($x) != 2) {
                // error
                $message = "Invalid parameters format (dimension)";
                $result = -8;
                break;
            } else {
                $widths[$i] = $x[0];
                $heights[$i] = $x[1];
                $i++;
            }
        }
    }
    if ($result == 0) {
        $result = convert_posting($src, $dst, $widths, $heights, $lcd);
        //$result = convert_theme( $src, $dst, $widths, $heights );
    }
    echo ${result} . ':' . ${message};
}
예제 #2
0
             $message = "Invalid parameters format (dimension)";
             break;
         } else {
             $widths[$i] = $x[0];
             $heights[$i] = $x[1];
             $i++;
         }
     }
 } else {
     // error
     $result = 100;
     $message = "Missing parameters(dimension)";
 }
 if ($result == 0) {
     if ($type == 'posting') {
         $image_info = convert_posting($src, $dst, $widths, $heights);
         $message = $image_info[0] . 'x' . $image_info[1];
     } else {
         if ($type == 'theme') {
             $image_info = convert_theme($src, $dst, $widths, $heights);
             $message = $image_info[0] . 'x' . $image_info[1];
         } else {
             if ($type == 'profile') {
                 $image_info = convert_profile($src, $dst, $widths, $heights);
                 $message = $image_info[0] . 'x' . $image_info[1];
             } else {
                 $result = 303;
                 $message = "Invalid parameter. type=" . $type;
             }
         }
     }