• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getHeight函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getHeight函数的典型用法代码示例。如果您正苦于以下问题:PHP getHeight函数的具体用法?PHP getHeight怎么用?PHP getHeight使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getHeight函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: createNpc

function createNpc()
{
    $trait_table = "npc_traits";
    $table = "npc";
    $columns = getColumnNames($table);
    if (empty($_POST["sex"])) {
        $_POST["sex"] = getGender();
    }
    if (empty($_POST["weight"])) {
        $_POST["weight"] = getWeight();
    }
    if (empty($_POST["feet"]) || empty($_POST["inches"])) {
        $_POST["height"] = getHeight();
    } else {
        $_POST["height"] = $_POST["feet"] * 12 + $_POST["inches"];
    }
    if (empty($_POST["age"])) {
        $_POST["age"] = getAge();
    }
    if (empty($_POST["first_name"])) {
        $_POST["first_name"] = getName();
    }
    // will add the remaining traits not already added
    foreach ($columns as $column) {
        if (empty($_POST[$column])) {
            $_POST[$column] = getTrait($trait_table, $column);
        }
    }
}
开发者ID:Cassioblu55,项目名称:aesop_php,代码行数:29,代码来源:npc.php


示例2: getRow

 public function getRow($y, $row = null)
 {
     if ($y < 0 || $y >= getHeight()) {
         throw new IllegalArgumentException("Requested row is outside the image: " + y);
     }
     $width = $this->getWidth();
     if ($row == null || count($row) < $width) {
         $row = array();
         //new byte[width];
     }
     $offset = ($y + $this->top) * $this->dataWidth + $this->left;
     $row = arraycopy($this->yuvData, $offset, $row, 0, $width);
     return $row;
 }
开发者ID:jumong,项目名称:php-qrcode-detector-decoder,代码行数:14,代码来源:PlanarYUVLuminanceSource.php


示例3: changeAvatar

function changeAvatar()
{
    $post = isset($_POST) ? $_POST : array();
    $max_width = "500";
    $userId = isset($post['hdn-profile-id']) ? intval($post['hdn-profile-id']) : 0;
    $path = 'images/tmp';
    $valid_formats = array("jpg", "png", "gif", "bmp", "jpeg");
    $name = $_FILES['photoimg']['name'];
    $size = $_FILES['photoimg']['size'];
    if (strlen($name)) {
        list($txt, $ext) = explode(".", $name);
        if (in_array($ext, $valid_formats)) {
            if ($size < 1024 * 1024) {
                $actual_image_name = 'avatar' . '_' . $userId . '.' . $ext;
                $filePath = $path . '/' . $actual_image_name;
                $tmp = $_FILES['photoimg']['tmp_name'];
                if (move_uploaded_file($tmp, $filePath)) {
                    $width = getWidth($filePath);
                    $height = getHeight($filePath);
                    //Scale the image if it is greater than the width set above
                    if ($width > $max_width) {
                        $scale = $max_width / $width;
                        $uploaded = resizeImage($filePath, $width, $height, $scale);
                    } else {
                        $scale = 1;
                        $uploaded = resizeImage($filePath, $width, $height, $scale);
                    }
                    /*$res = saveAvatar(array(
                      'userId' => isset($userId) ? intval($userId) : 0,
                                              'avatar' => isset($actual_image_name) ? $actual_image_name : '',
                      ));*/
                    //mysql_query("UPDATE users SET profile_image='$actual_image_name' WHERE uid='$session_id'");
                    echo "<img id='photo' file-name='" . $actual_image_name . "' class='' src='" . $filePath . '?' . time() . "' class='preview'/>";
                } else {
                    echo "failed";
                }
            } else {
                echo "Image file size max 1 MB";
            }
        } else {
            echo "Invalid file format..";
        }
    } else {
        echo "Please select image..!";
    }
    exit;
}
开发者ID:riteshtandon23,项目名称:WeRHR,代码行数:47,代码来源:profile12.php


示例4: chmod

            chmod($large_image_location, 0777);
            $width = getWidth($large_image_location);
            $height = getHeight($large_image_location);
            //Scale the image if it is greater than the width set above
            if ($width > $max_width) {
                $scale = $max_width / $width;
                $uploaded = resizeImage($large_image_location, $width, $height, $scale);
            } else {
                $scale = 1;
                $uploaded = resizeImage($large_image_location, $width, $height, $scale);
            }
            //Delete the thumbnail file so the user can create a new one
            /*if (file_exists($thumb_image_location)) {
            			unlink($thumb_image_location);
            		}*/
            echo "success|" . str_replace(JPATH_ROOT . '/', JURI::root(), $large_image_location) . "|" . getWidth($large_image_location) . "|" . getHeight($large_image_location);
        }
    } else {
        echo "error|" . $error;
    }
}
########################################################
#	CREATE THE THUMBNAIL							   #
########################################################
if (JRequest::getVar('save_thumb') == "Save Thumbnail") {
    //Get the new coordinates to crop the image.
    $x1 = $_POST["x1"];
    $y1 = $_POST["y1"];
    $x2 = $_POST["x2"];
    $y2 = $_POST["y2"];
    $w = $_POST["w"];
开发者ID:psytronica,项目名称:zygoprofile,代码行数:31,代码来源:avatar_process.php


示例5: getWidth

        echo 'uppics/' . $picarr[0]['picpath'];
        ?>
" width="<?php 
        echo getWidth('uppics/' . $picarr[0]['picpath'], 640, 480);
        ?>
" height="<?php 
        echo getHeight('uppics/' . $picarr[0]['picpath'], 640, 480);
        ?>
" style="cursor:hand;" onclick="lookpic()" /><div style="line-height:25px;">ͼƬÃû³Æ£º&nbsp;<?php 
        echo $picarr[0]['picname'];
        ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ͼƬ¸ñʽ£º<?php 
        echo getWidth('uppics/' . $picarr[0]['picpath']);
        ?>
 * <?php 
        echo getHeight('uppics/' . $picarr[0]['picpath']);
        ?>
&nbsp;&nbsp;</div><div align="left" style="line-height:25px; text-indent:20px;">ͼƬÃèÊö£º&nbsp;<?php 
        echo $picarr[0]['bewrite'];
        ?>
</div></div></td>
	</tr>
	<tr>
		<td height="25" align="center" valign="middle">&nbsp;<?php 
        $albumsql = "select * from tb_album where typename = " . $smallact;
        $num = $conne->getRowsNum($albumsql);
        if ($num == 1) {
            ?>
		<a onclick="javascript:open('try.php?typename=<?php 
            echo $smallact;
            ?>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:pics.php


示例6: getUebersetzung

</option>
                                <?php 
        }
        ?>
                            </select>
                        </div>
                        <div class="col-sm-offset-4 col-sm-3">
                            <div class="alert alert-info" style="width: auto;">
                                <label class="control-label">
                                    <?php 
        echo getUebersetzung("vorheriger Wert", $sprache, $link);
        ?>
:
                                </label>
                                <?php 
        echo getHeight($style);
        ?>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <hr>
                    </div>
                <?php 
    }
    ?>
                <?php 
    if ($width == "1") {
        ?>
                    <div class="row">
                        <div class="col-sm-2">
开发者ID:utilo-web-app-development,项目名称:REZERVI,代码行数:31,代码来源:styles.php


示例7: blogsmu_features_page


//.........这里部分代码省略.........
    if (isset($_POST['upload1'])) {
        //Get the file information
        $userfile_name = $_FILES['image']['name'];
        $userfile_tmp = $_FILES['image']['tmp_name'];
        $userfile_type = $_FILES['image']['type'];
        $userfile_size = $_FILES['image']['size'];
        $filename = basename($_FILES['image']['name']);
        $file_ext = substr($filename, strrpos($filename, '.') + 1);
        //Only process if the file is a JPG, PNG or GIF and below the allowed limit
        if (!empty($_FILES["image"]) && $_FILES['image']['error'] == 0) {
            foreach ($allowed_image_types as $mime_type => $ext) {
                //loop through the specified image types and if they match the extension then break out
                //everything is ok so go and check file size
                if ($file_ext == $ext && $userfile_type == $mime_type) {
                    $error = "";
                    break;
                } else {
                    $error = __("Only", TEMPLATE_DOMAIN) . "<strong>" . $image_ext . "</strong>" . __("images accepted for upload", TEMPLATE_DOMAIN) . "<br />";
                }
            }
            //check if the file size is above the allowed limit
            if ($userfile_size > $max_file) {
                $error .= __("Images must be under 1 MB in size", TEMPLATE_DOMAIN);
            }
        } else {
            $error = __("Select an image to upload", TEMPLATE_DOMAIN);
        }
        //Everything is ok, so we can upload the image.
        if (strlen($error) == 0) {
            if (isset($_FILES['image']['name'])) {
                move_uploaded_file($userfile_tmp, $large_image_location);
                chmod($large_image_location, 0777);
                $width = getWidth($large_image_location);
                $height = getHeight($large_image_location);
                //Scale the image if it is greater than the width set above
                if ($width > $max_width) {
                    $scale = $max_width / $width;
                    $uploaded = resizeImage($large_image_location, $width, $height, $scale);
                } else {
                    $scale = 1;
                    $uploaded = resizeImage($large_image_location, $width, $height, $scale);
                }
                //Delete the thumbnail file so the user can create a new one
                if (file_exists($thumb_image_location)) {
                    unlink($thumb_image_location);
                }
            }
            //Refresh the page to show the new uploaded image
            print '<meta http-equiv="Pragma" content="no-cache">';
            echo "<h4 id=\"loading-bar\">Please wait..Your Image Currently Processing</h4>";
            echo '<img src="' . get_template_directory_uri() . '/_inc/admin/loading_bar.gif' . '">';
            print "<meta http-equiv=\"refresh\" content=\"5;url={$ttpl_url}/wp-admin/themes.php?page=custom-homepage.php&#tab1\">";
            exit;
            //double refresh to clear cache..its a bit catchy but it get the job done
        }
    }
    ///////////////////////////////////////////////////////////////////////////////
    // if upload with no crop features
    ///////////////////////////////////////////////////////////////////////////////
    if (isset($_POST["normal_upload1"])) {
        //Get the file information
        $userfile_name = $_FILES['image']['name'];
        $userfile_type = $_FILES['image']['type'];
        $userfile_tmp = $_FILES['image']['tmp_name'];
        $userfile_size = $_FILES['image']['size'];
        $filename = basename($_FILES['image']['name']);
开发者ID:hscale,项目名称:webento,代码行数:67,代码来源:services-functions.php


示例8: Photo

    echo $_SERVER["PHP_SELF"];
    ?>
" method="post">
Photo (jpg o gif) <input type="file" name="image" size="30" /> <input type="submit" name="upload" value="Carica" />
</form>

<?php 
}
//Display error message if there are any
if (isset($error) && strlen($error) > 0) {
    echo "<ul style=\"margin:4px 0px 14px 0px;\"><li><strong>Errore!</strong></li><li>" . $error . "</li></ul>";
}
if (isset($immagineDaUsare) and strlen($immagineDaUsare) > 0 and (!isset($_POST["nStep"]) or $_POST["nStep"] != "3")) {
    // controllo se l'immagine caricata è più piccola della thumb
    $width_caricata = getWidth($immagineDaUsare);
    $height_caricata = getHeight($immagineDaUsare);
    if ($width_caricata <= $thumb_width && $height_caricata <= $thumb_height) {
        $x1_value = 0;
        $y1_value = 0;
        $x2_value = $x1_value + $width_caricata;
        $y2_value = $y1_value + $height_caricata;
        $w_value = $width_caricata;
        $h_value = $height_caricata;
        ?>
			<h2><u>Step <?php 
        print $nStep;
        ?>
</u>: <?php 
        print $creaImg;
        ?>
</h2>
开发者ID:pnicorelli,项目名称:cms-startkit,代码行数:31,代码来源:upload_image.php


示例9: getWidth

    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>WeMakeScholars - Upload Profile Picture</title>
    <link href="/css/custom.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/cropjs/jquery-pack.js"></script>
	<script type="text/javascript" src="/cropjs/jquery.imgareaselect.min.js"></script>
</head>
<body>

<?php 
    //Only display the javacript if an image has been uploaded
    if (strlen($large_photo_exists) > 0) {
        $current_large_image_width = getWidth($large_image_location);
        $current_large_image_height = getHeight($large_image_location);
        ?>
<script type="text/javascript">
function preview(img, selection) { 
	var scaleX = <?php 
        echo $thumb_width;
        ?>
 / selection.width; 
	var scaleY = <?php 
        echo $thumb_height;
        ?>
 / selection.height; 
	
	$('#thumbnail + div > img').css({ 
		width: Math.round(scaleX * <?php 
        echo $current_large_image_width;
开发者ID:EarthBug,项目名称:irksome-barnacle,代码行数:31,代码来源:uploadcrop.php


示例10: getWidth

        ?>
" target="showpic">
<?php 
    }
    ?>
		<img id = "indexpic<?php 
    echo $key;
    ?>
" src="<?php 
    echo $typevalue['level'] == 0 ? '../uppics/' . $typevalue['indexpic'] : '../images/mimi.jpg';
    ?>
 " width="<?php 
    echo getWidth($typevalue['level'] == 0 ? '../uppics/' . $typevalue['indexpic'] : '../images/mimi.jpg', 150, 100);
    ?>
" height="<?php 
    echo getHeight($typevalue['level'] == 0 ? '../uppics/' . $typevalue['indexpic'] : '../images/mimi.jpg', 150, 100);
    ?>
" border="0"/>
<?php 
    if ($num != 0) {
        ?>
	
		</a>
<?php 
    }
    ?>
		</td>
	</tr>
	<tr>
		<td height="25" align="center" valign="middle">Ãû³Æ£º<?php 
    echo $typevalue['typename'];
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:typelist.php


示例11: move_uploaded_file

            $err .= "ONLY jpg images are accepted for upload";
        }
    } else {
        $err .= "Select a jpg image for upload";
    }
    echo $err;
    if ($err == "") {
        $image_loc = $upload_dir . $user_filename;
        if (isset($_FILES["image"]["name"])) {
            if (file_exists($upload_dir . $user_filename)) {
                echo $user_filename . " already exists. ";
            } else {
                move_uploaded_file($user_filename_temp, $image_loc);
                chmod($image_loc, 0777);
                $width = getWidth($image_loc);
                $height = getHeight($image_loc);
                echo "<img src='{$image_loc}' />";
                if ($width > $max_width) {
                    $scale = $max_width / $width;
                    $uploaded = resizeImage($image_loc, $width, $height, $scale);
                } else {
                    $scale = 1;
                    $uploaded = resizeImage($image_loc, $width, $height, $scale);
                }
            }
        }
    }
}
function getWidth($image)
{
    $sizes = getimagesize($image);
开发者ID:hderanga,项目名称:snaptag,代码行数:31,代码来源:addItems.php


示例12: wpmudev_custom_homepage_admin


//.........这里部分代码省略.........
    ///////////////////////////////////////////////////////////////////////////////
    if (isset($_POST["upload"])) {
        //Get the file information
        $userfile_name = $_FILES['image']['name'];
        $userfile_type = $_FILES['image']['type'];
        $userfile_tmp = $_FILES['image']['tmp_name'];
        $userfile_size = $_FILES['image']['size'];
        $filename = basename($_FILES['image']['name']);
        $file_ext = substr($filename, strrpos($filename, '.') + 1);
        //Only process if the file is a JPG and below the allowed limit
        if (!empty($_FILES["image"]) && $_FILES['image']['error'] == 0) {
            foreach ($allowed_image_types as $mime_type => $ext) {
                //loop through the specified image types and if they match the extension then break out
                //everything is ok so go and check file size
                if ($file_ext == $ext && $userfile_type == $mime_type) {
                    $error = "";
                    break;
                } else {
                    $error = __("Only", TEMPLATE_DOMAIN) . "<strong>" . $image_ext . "</strong>" . __("images accepted for upload", TEMPLATE_DOMAIN) . "<br />";
                }
            }
            if ($userfile_size > $max_file) {
                $error = __("ONLY images under 1MB are accepted for upload", TEMPLATE_DOMAIN);
            }
        } else {
            $error = __("Select an image for upload", TEMPLATE_DOMAIN);
        }
        //Everything is ok, so we can upload the image.
        if (strlen($error) == 0) {
            if (isset($_FILES['image']['name'])) {
                move_uploaded_file($userfile_tmp, $large_image_location);
                chmod($large_image_location, 0777);
                $width = getWidth($large_image_location);
                $height = getHeight($large_image_location);
                //Scale the image if it is greater than the width set above
                if ($width > $max_width) {
                    $scale = $max_width / $width;
                    $uploaded = resizeImage($large_image_location, $width, $height, $scale);
                } else {
                    $scale = 1;
                    $uploaded = resizeImage($large_image_location, $width, $height, $scale);
                }
                //Delete the thumbnail file so the user can create a new one
                if (file_exists($thumb_image_location)) {
                    unlink($thumb_image_location);
                }
            }
            //Refresh the page to show the new uploaded image
            print '<meta http-equiv="Pragma" content="no-cache">';
            echo "<h4 id=\"loading-bar\">Please wait..Your Image Currently Processing</h4>";
            echo '<img src="' . get_template_directory_uri() . '/_inc/admin/loading_bar.gif' . '">';
            print "<meta http-equiv=\"refresh\" content=\"1;url={$ttpl_url}/wp-admin/themes.php?page=custom-homepage.php\">";
            print "<script>";
            print " self.location='{$ttpl_url}/wp-admin/themes.php?page=custom-homepage.php&#tab1';";
            print "</script>";
            exit;
        }
    }
    //echo admin_url( 'themes.php?page=custom-homepage#tab1' );
    ///////////////////////////////////////////////////////////////////////////////
    // if upload with no crop features
    ///////////////////////////////////////////////////////////////////////////////
    if (isset($_POST["normal-upload"])) {
        //Get the file information
        $userfile_name = $_FILES['image']['name'];
        $userfile_type = $_FILES['image']['type'];
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:67,代码来源:options-functions.php


示例13: rotate180

 /**
  * Modifies this {@code BitMatrix} to represent the same but rotated 180 degrees
  */
 public function rotate180()
 {
     $width = $this->getWidth();
     $height = $this - getHeight();
     $topRow = new BitArray($width);
     $bottomRow = new BitArray($width);
     for ($i = 0; $i < ($height + 1) / 2; $i++) {
         $topRow = $this->getRow($i, $topRow);
         $bottomRow = $this->getRow($height - 1 - $i, $bottomRow);
         $topRow->reverse();
         $bottomRow->reverse();
         $this->setRow($i, $bottomRow);
         $this->setRow($height - 1 - $i, $topRow);
     }
 }
开发者ID:jumong,项目名称:php-qrcode-detector-decoder,代码行数:18,代码来源:BitMatrix.php


示例14: imagickCrop

            } else {
                imagickCrop($image, '50%', '50%', $width, $height);
            }
        } else {
            $image->thumbnailImage($width, $height, $width && $height);
        }
    }
    $image->writeImage($newFilename);
}
// ------------------------ program -----------------------------------
$file = getFile();
if (isLocalFile($file)) {
    checkFilename($file);
    existsFile($file);
}
$height = getHeight();
$width = getWidth();
$exact = getExact();
$topCut = getTopCut();
if (isLocalFile($file)) {
    $newFilename = getResizedFilename($file, $height, $width, $exact, $topCut);
} else {
    $newFilename = getRemoteResizedFilename($file, $height, $width, $exact, $topCut);
}
if (!existsFile($newFilename, false)) {
    try {
        if (shouldSendOriginal($file, $height, $width, $exact || $topCut)) {
            sendFile($file);
        }
        requireImageClass();
        if (false && isLocalFile($file) && extension_loaded('imagick')) {
开发者ID:kysela-petr,项目名称:generator-kysela,代码行数:31,代码来源:min.php


示例15: move_uploaded_file

     }
 } else {
     $error = "Select an image for upload";
 }
 //Everything is ok, so we can upload the image.
 if (strlen($error) == 0) {
     if (isset($_FILES['image']['name'])) {
         //this file could now has an unknown file extension (we hope it's one of the ones set above!)
         $large_image_location = $large_image_location . "." . $file_ext;
         $thumb_image_location = $thumb_image_location . "." . $file_ext;
         //put the file ext in the session so we know what file to look for once its uploaded
         $_SESSION['user_file_ext'] = "." . $file_ext;
         move_uploaded_file($userfile_tmp, $large_image_location);
         chmod($large_image_location, 0777);
         $width = getWidth($large_image_location);
         $height = getHeight($large_image_location);
         //Scale the image if it is greater than the width set above
         if ($width > $max_width) {
             $scale = $max_width / $width;
             $uploaded = resizeImage($large_image_location, $width, $height, $scale);
         } else {
             $scale = 1;
             $uploaded = resizeImage($large_image_location, $width, $height, $scale);
         }
         //Delete the thumbnail file so the user can create a new one
         if (file_exists($thumb_image_location)) {
             unlink($thumb_image_location);
         }
     }
     //Refresh the page to show the new uploaded image
     header("location:" . $_SERVER["PHP_SELF"]);
开发者ID:jmirsteinban,项目名称:IntraWeb,代码行数:31,代码来源:imgFunc.php


示例16: if

}else if(way == 'left'){
	setInterval(fromrighttoleft,30);
}
</script>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
	<td height="600">&nbsp;</td>
	<td style="width:800px;"><div id="zero" style="width:800px; height:600px; top:100px; position:absolute;">
<?php 
foreach ($tmparr as $key => $value) {
    ?>
<div id="num<?php 
    echo $key;
    ?>
" style="position:absolute; vertical-align:middle; visibility:hidden; top:0px;"><img src="../uppics/<?php 
    echo $value;
    ?>
" width="<?php 
    echo getWidth('../uppics/' . $value, 800, 600);
    ?>
" height="<?php 
    echo getHeight('../uppics/' . $value, 800, 600);
    ?>
" border="0" /></div>
<?php 
}
?>
</div></td>
	<td>&nbsp;</td>
</tr>
</table>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:try.php


示例17: header

header("Content-Type:text/html;charset=gb2312");
include_once 'conn/conn.php';
include_once 'admin/inc/func.php';
$picpath = $_GET['picpath'];
$smallact = $_GET['smallact'];
$tmppath = substr(strrchr($picpath, '/'), 1);
$psql = "select id,picname,bewrite,upname from tb_photo where picpath = '" . $tmppath . "'";
$parr = $conne->getRowsRst($psql);
?>
<img id = "bigimg" src="<?php 
echo $picpath;
?>
" width="<?php 
echo getWidth($picpath, 640, 480);
?>
" height="<?php 
echo getHeight($picpath, 640, 480);
?>
" style="cursor:hand;" onclick="lookpic()" /><div style="line-height:25px;">ͼƬ���ƣ�&nbsp;<?php 
echo $parr['picname'];
?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ͼƬ��ʽ��<?php 
echo getWidth($picpath);
?>
 * <?php 
echo getHeight($picpath);
?>
&nbsp;&nbsp;</div><div align="left" style="line-height:25px; text-indent:20px;">ͼƬ������&nbsp;<?php 
echo $parr['bewrite'];
?>
</div>
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:showpic.php


示例18: form_file


//.........这里部分代码省略.........
                     }
                 }
             }
             //JPG, PNG, GIF 가 아니라면
             if ($file_type == 1) {
                 $this->assigns['error_str'] = "그림파일이 아닙니다.";
                 return;
             }
             //이미지 허용 크기를 벗어남
             if ($userfile_size > $this->settings->max_file * 1048576) {
                 $this->assigns['error_str'] = "파일 사이즈 " . $this->settings->max_file . "MB 이하의 파일만 업로드 할 수 있습니다.";
                 return;
             }
         } else {
             //이미지에 에러가 있음
             $this->assigns['error_str'] = "이미지 데이터 오류가 났습니다. 다시 업로드해 주세요.";
             return;
         }
         //업로드를 변경 했다면
         if (isset($_FILES['file']['name'])) {
             if ($sub_dir == 'media/member/') {
                 $sub_large_image_location = 'media/temp/' . $tmp_filename;
             } else {
                 $minus_base_nm = str_replace(basename($sub_dir), '', $sub_dir);
                 if ($minus_base_nm == 'media/startup/') {
                     $sub_large_image_location = $minus_base_nm . $tmp_filename;
                 } else {
                     $sub_large_image_location = 'media/temp/' . $tmp_filename;
                 }
             }
             $large_image_location = $this->settings->root_path . $sub_large_image_location;
             move_uploaded_file($userfile_tmp, $large_image_location);
             $width = getWidth($large_image_location);
             $height = getHeight($large_image_location);
             if ($width > $max_width) {
                 $scale = $max_width / $width;
                 $uploaded = resizeImage($large_image_location, $width, $height, $scale);
             } else {
                 $scale = 1;
                 $uploaded = resizeImage($large_image_location, $width, $height, $scale);
             }
         }
         //이미지 사이즈가 작으면 선택영역을 최대로 한다.
         $temp_width = getWidth($uploaded);
         $temp_height = getHeight($uploaded);
         if ($thumb_height == $thumb_width) {
             if ($temp_width < $thumb_width) {
                 $resize_width = $temp_width;
             }
             if ($temp_height < $thumb_height) {
                 $resize_height = $temp_height;
             }
             if ($resize_width > $resize_height) {
                 $resize_width = $resize_height;
             } else {
                 $resize_height = $resize_width;
             }
         } else {
             //둘 다 현재 이미지 보다 큰 경우
             if ($resize_height > $temp_height && $resize_width > $temp_width) {
                 $resize_width = $temp_width;
                 $resize_height = $temp_height;
                 if ($resize_width > $resize_height) {
                     $resize_width = $resize_height * ($thumb_width / $thumb_height);
                 } else {
                     $resize_height = $resize_width * ($thumb_height / $thumb_width);
开发者ID:byyeong,项目名称:dc2016,代码行数:67,代码来源:ajax_front.php


示例19: array

        $inputVideoMediaConfiguration = $inputMediaConfiguration;
        break;
    }
}
if (is_null($inputVideoMediaConfiguration)) {
    throw new \Exception("No video media configuration found!");
}
$inputWidth = $inputVideoMediaConfiguration->displayAspectRatioNum;
$inputHeight = $inputVideoMediaConfiguration->displayAspectRatioDen;
$aspectRatio = $inputWidth / $inputHeight;
// Predefined widths
$widths = array(426, 640, 854, 1280, 1920);
$bitrates = array(400 * 1000, 800 * 1000, 1200 * 1000, 2400 * 1000, 4800 * 1000);
$heights = array();
foreach ($widths as $width) {
    array_push($heights, getHeight($width, $aspectRatio));
}
$videoStreamConfigurations = array();
for ($i = 0; $i < count($widths); $i++) {
    $videoStreamConfiguration = new VideoStreamConfig();
    $videoStreamConfiguration->width = $widths[$i];
    $videoStreamConfiguration->height = $heights[$i];
    $videoStreamConfiguration->bitrate = $bitrates[$i];
    array_push($videoStreamConfigurations, $videoStreamConfiguration);
}
$audioStreamConfig = new AudioStreamConfig();
$audioStreamConfig->bitrate = 128000;
$encodingProfileConfig = new EncodingProfileConfig();
$encodingProfileConfig->name = 'API TEST PROFILE DELETE';
$encodingProfileConfig->videoStreamConfigs = $videoStreamConfigurations;
$encodingProfileConfig->audioStreamConfigs[] = $audioStreamConfig;
开发者ID:bitmovin,项目名称:bitcodin-php,代码行数:31,代码来源:createJobWithAutoEncodingProfile.php


示例20: getWidth

        ?>
" target="showpic">
<?php 
    }
    ?>
		<img id = "indexpic<?php 
    echo $key;
    ?>
" src="<?php 
    echo $num != 0 ? 'uppics/' . $typevalue['indexpic'] : 'images/null.jpg';
    ?>
 " width="<?php 
    echo getWidth($num != 0 ? 'uppics/' . $typevalue['indexpic'] : 'images/null.jpg', 130, 100);
    ?>
" height="<?php 
    echo getHeight($num != 0 ? 'uppics/' . $typevalue['indexpic'] : 'images/null.jpg', 130, 100);
    ?>
" border="0"/>
<?php 
    if ($num != 0) {
        ?>
	
		</a>
<?php 
    }
    ?>
		</td>
	</tr>
	<tr>
		<td height="25" align="center" valign="middle">名称:<?php 
    echo $typevalue['typename'];
开发者ID:Arrray,项目名称:PHPpractice,代码行数:31,代码来源:center.php



注:本文中的getHeight函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getHighestGroupedAction函数代码示例发布时间:2022-05-15
下一篇:
PHP getHeader函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap