本文整理汇总了PHP中SimpleImage::fit_to_height方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleImage::fit_to_height方法的具体用法?PHP SimpleImage::fit_to_height怎么用?PHP SimpleImage::fit_to_height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::fit_to_height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mktime
$query = mysql_query("SELECT * FROM vbildergalerien WHERE galID = '" . mysql_escape_string($_POST['_idGallery']) . "'");
$row = mysql_fetch_array($query);
$images = $row['galBilder'] . ';' . $imageId;
mysql_query("UPDATE vbildergalerien SET galBilder='" . $images . "' WHERE galID='" . mysql_escape_string($_POST['_idGallery']) . "'");
$idGallery = $_POST['_idGallery'];
}
$categoryID = $insertId;
$status = null;
} else {
try {
$newName = mktime() . 'crop_' . $value;
$imageClass = new SimpleImage('../../../user_upload/' . $value);
if (!empty($_POST['_height']) && !empty($_POST['_width'])) {
$imageClass->resize($_POST['_width'], $_POST['_height']);
} elseif (!empty($_POST['_height'])) {
$imageClass->fit_to_height($_POST['_height']);
} else {
$imageClass->fit_to_width($_POST['_width']);
}
//$imageClass->contrast(50);
$imageClass->save('../../../user_upload/' . $newName, $_POST['_quality']);
$imageClass->resize(200, 200);
$imageClass->save('../../../user_upload/thumb_200/' . $newName, 90);
$imageClass1 = new SimpleImage('../../../user_upload/' . $newName);
$imageClass1->fit_to_width(400);
$imageClass1->save('../../../user_upload/thumb_400/' . $newName, $_POST['_quality']);
$imageClass2 = new SimpleImage('../../../user_upload/' . $newName);
$imageClass2->fit_to_width(800);
$imageClass2->save('../../../user_upload/thumb_800/' . $newName, $_POST['_quality']);
if ($i == 1) {
mysql_query("INSERT INTO vbildkategorie SET katName='" . $_POST['_newCategory1'] . "',katParent='" . $_POST['_inCategory'] . "'");
示例2: SimpleImage
$file = '';
}
if (empty($file) || !file_exists($root . $file)) {
$file = '/noimage.jpg';
}
echo $file;
exit;
$fileRes = '/resize/' . $height . '/' . $width . '/' . $type . $file;
$file = $root . $file;
$fileRes = $root . $fileRes;
if (!file_exists($fileRes)) {
require_once $root . '/SimpleImage.php';
$simpleImage = new SimpleImage();
$simpleImage->load($file);
switch ($type) {
case 'no':
$simpleImage->square_crop($height, $width);
break;
case 'w':
$simpleImage->fit_to_width($width);
break;
case 'h':
$simpleImage->fit_to_height($height);
break;
case 's':
$simpleImage->resize($height, $width);
break;
}
createFolders($fileRes);
$simpleImage->save($fileRes);
}