当前位置: 首页>>代码示例>>PHP>>正文


PHP getHeight函数代码示例

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


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


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