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


PHP ImageManager::cut方法代碼示例

本文整理匯總了PHP中ImageManager::cut方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::cut方法的具體用法?PHP ImageManager::cut怎麽用?PHP ImageManager::cut使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ImageManager的用法示例。


在下文中一共展示了ImageManager::cut方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: imageCut

/**
 * @deprecated 1.5.0
 */
function imageCut($srcFile, $destFile, $destWidth = NULL, $destHeight = NULL, $fileType = 'jpg', $destX = 0, $destY = 0)
{
    Tools::displayAsDeprecated();
    if (isset($srcFile['tmp_name'])) {
        return ImageManager::cut($srcFile['tmp_name'], $destFile, $destWidth, $destHeight, $fileType, $destX, $destY);
    }
    return false;
}
開發者ID:IngenioContenidoDigital,項目名稱:americana,代碼行數:11,代碼來源:images.inc.php

示例2: import_media_img

 }
 public static function import_media_img($file_url, $folder, $filename)
 {
     // $folder = rev_media_folder();
     $wpdb = rev_db_class::rev_db_instance();
     copy($file_url, $folder . $filename);
     $imagearray = array('file_name' => $filename);
     $mysqli = $wpdb->insert($wpdb->prefix . GlobalsRevSlider::TABLE_ATTACHMENT_IMAGES, $imagearray);
     $imgid = $wpdb->Insert_ID();
     if (!empty($mysqli) && is_numeric($imgid)) {
         //new fixing
         $sizes = array(GlobalsRevSlider::IMAGE_SIZE_THUMBNAIL, GlobalsRevSlider::IMAGE_SIZE_MEDIUM, GlobalsRevSlider::IMAGE_SIZE_LARGE);
         $filerealname = substr($filename, 0, strrpos($filename, '.'));
         $fileext = substr($filename, strrpos($filename, '.'), strlen($filename) - strlen($filerealname));
         list($width, $height) = getimagesize($folder . $filename);
         $count = 0;
         foreach ($sizes as $size) {
             $nsize = self::get_img_aspect_ratio(array($width, $height, $size));
             $newfilename = "{$filerealname}-{$size}x{$size}{$fileext}";
             if (++$count > 1) {
                 ImageManager::resize($folder . $filename, $folder . $newfilename, $nsize[0], $nsize[1]);
             } else {
                 $posx = $width / 2 - $size / 2;
                 $posy = $height / 2 - $size / 2;
                 ImageManager::cut($folder . $filename, $folder . $newfilename, $size, $size, substr($fileext, 1), $posx, $posy);
             }
         }
         return array("id" => $imgid, "path" => 'uploads/' . $filename);
         // return array("id" => $imgid, "path" => $filename);
     }
開發者ID:evgrishin,項目名稱:se1614,代碼行數:30,代碼來源:functions_wordpress.class.php


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