當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleImage::thumbnail方法代碼示例

本文整理匯總了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";
開發者ID:salomay,項目名稱:refreshin,代碼行數:31,代碼來源:index.php

示例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']));
         }
     }
 }
開發者ID:visavi,項目名稱:rotorcms,代碼行數:31,代碼來源:UserController.php

示例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);
}
開發者ID:retio,項目名稱:SimpleImage,代碼行數:18,代碼來源:process-image.php


注:本文中的SimpleImage::thumbnail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。