本文整理汇总了PHP中SimpleImage::thumbnail方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleImage::thumbnail方法的具体用法?PHP SimpleImage::thumbnail怎么用?PHP SimpleImage::thumbnail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleImage
的用法示例。
在下文中一共展示了SimpleImage::thumbnail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
$imgx->load($src_img);
#-- check orientation ------------
if (!empty($exif['Orientation'])) {
switch ($exif['Orientation']) {
case 3:
$imgx->rotate(180);
break;
case 6:
$imgx->rotate(90);
break;
case 8:
$imgx->rotate(-90);
break;
}
}
$imgx->thumbnail(500, 300);
$imgx->save($app['data_path'] . "/konfig/gmb_header_" . $id . ".jpg");
$data['gmb_header'] = "gmb_header_" . $id . ".jpg";
} catch (Exception $e) {
$_SESSION['msg'] = "gambar header gagal di unggah/upload ....";
$_SESSION['alt'] = "warning";
header("location: " . $urlx->get_referer());
exit;
}
}
$appx->mq_encode('p_headline,p_slogan');
$sql = "update " . $app['table']["konfig_bahasa"] . "\n\t\t\t\tset headline = '{$p_headline}', \n\t\t\t\t id_bahasa = '{$p_bahasa}',\n\t\t\t\t slogan = '{$p_slogan}',\n\t\t\t\t\tmeta_description = '{$p_metades}',\n\t\t\t\t\tmeta_keyword = '{$p_metakey}',\n\t\t\t\t\tgmb_header = '{$data['gmb_header']}',\n\t\t\t\t\ttgl_modif = now()\n\t\t\t\twhere id = '{$p_id}'";
// echo $sql;exit;
$dbu->qry($sql);
$_SESSION['msg'] = "Data Provinsi {$p_nama} Berhasil Di Update ....";
$_SESSION['alt'] = "success";
示例2: image
/**
* Загрузка фото в профиль
*/
public function image()
{
if (!Request::ajax() || !User::check()) {
App::redirect('/');
}
// Удаление и размер
$image = Request::file('image');
if ($image->isValid()) {
$ext = $image->getClientOriginalExtension();
if (in_array($ext, ['jpeg', 'jpg', 'png', 'gif'])) {
$filename = uniqid(mt_rand()) . '.' . $ext;
$user = User::get();
$user->deleteImages();
$img = new SimpleImage($image->getPathName());
$img->best_fit(1280, 1280)->save('uploads/users/photos/' . $filename);
$img->best_fit(200, 200)->save('uploads/users/thumbs/' . $filename);
$img->thumbnail(48, 48)->save('uploads/users/avatars/' . $filename);
$user->avatar = $filename;
if ($user->save()) {
exit(json_encode(['status' => 'uploaded']));
} else {
exit(json_encode(['status' => 'nosave']));
}
} else {
exit(json_encode(['status' => 'invalid']));
}
}
}
示例3: SimpleImage
<?php
require_once 'class/SimpleImage.class.php';
$sampleImage = 'image/sample3.jpg';
if (file_exists($sampleImage)) {
$sImage = new SimpleImage();
$sImage->load($sampleImage);
$sImage->rotateDegrees = (int) $_GET['r'];
// $sImage->resize(350); // 800px width
// $sImage->resize(null, 350); // 800px width
// $sImage->resize(350, 350); // 800px width
// $sImage->thumbnail(120);
// $sImage->thumbnail(null,120);
$sImage->thumbnail(120, 120);
$sR = $sImage->saveThumbnail('image/resized.jpg');
$error = $sImage->error();
var_dump($error);
}