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


PHP new_thumbnails_creation函数代码示例

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


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

示例1: fix_strtolower

 $is_img = false;
 $is_video = false;
 $is_audio = false;
 $show_original = false;
 $show_original_mini = false;
 $mini_src = "";
 $src_thumb = "";
 $extension_lower = fix_strtolower($file_array['extension']);
 if (in_array($extension_lower, $ext_img)) {
     $src = $base_url . $cur_dir . rawurlencode($file);
     $mini_src = $src_thumb = $thumbs_path . $subdir . $file;
     //add in thumbs folder if not exist
     if (!file_exists($src_thumb)) {
         try {
             create_img_gd($file_path, $src_thumb, 122, 91);
             new_thumbnails_creation($current_path . $rfm_subfolder . $subdir, $file_path, $file, $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option);
         } catch (Exception $e) {
             $src_thumb = $mini_src = "";
         }
     }
     $is_img = true;
     //check if is smaller than thumb
     list($img_width, $img_height, $img_type, $attr) = getimagesize($file_path);
     if ($img_width < 122 && $img_height < 91) {
         $src_thumb = $current_path . $rfm_subfolder . $subdir . $file;
         $show_original = true;
     }
     if ($img_width < 45 && $img_height < 38) {
         $mini_src = $current_path . $rfm_subfolder . $subdir . $file;
         $show_original_mini = true;
     }
开发者ID:PotsonHumer,项目名称:OGS_V2,代码行数:31,代码来源:dialog.php

示例2: move_uploaded_file

 }
 $targetFile = $targetPath . $_FILES['file']['name'];
 $targetFileThumb = $targetPathThumb . $_FILES['file']['name'];
 if (in_array(fix_strtolower($info['extension']), $ext_img)) {
     $is_img = true;
 } else {
     $is_img = false;
 }
 move_uploaded_file($tempFile, $targetFile);
 chmod($targetFile, 0755);
 if ($is_img) {
     $memory_error = false;
     if (!create_img_gd($targetFile, $targetFileThumb, 122, 91)) {
         $memory_error = false;
     } else {
         if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height)) {
             $memory_error = false;
         } else {
             $imginfo = getimagesize($targetFile);
             $srcWidth = $imginfo[0];
             $srcHeight = $imginfo[1];
             if ($image_resizing) {
                 if ($image_resizing_width == 0) {
                     if ($image_resizing_height == 0) {
                         $image_resizing_width = $srcWidth;
                         $image_resizing_height = $srcHeight;
                     } else {
                         $image_resizing_width = $image_resizing_height * $srcWidth / $srcHeight;
                     }
                 } elseif ($image_resizing_height == 0) {
                     $image_resizing_height = $image_resizing_width * $srcHeight / $srcWidth;
开发者ID:heruprasetya,项目名称:Codeigniter-SMS-Gateway-Gammu,代码行数:31,代码来源:upload.php

示例3: pathinfo

     $info = pathinfo($_POST['name']);
     if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0 || strpos($_POST['url'], 'http://s3.amazonaws.com/feather') !== 0 && strpos($_POST['url'], 'https://s3.amazonaws.com/feather') !== 0 || $_POST['name'] != fix_filename($_POST['name'], $transliteration, $convert_spaces, $replace_with) || !in_array(strtolower($info['extension']), array('jpg', 'jpeg', 'png'))) {
         response('wrong data', 400)->send();
         exit;
     }
     $image_data = file_get_contents($_POST['url']);
     if ($image_data === false) {
         response(trans('Aviary_No_Save'), 400)->send();
         exit;
     }
     require_once 'include/php_image_magician.php';
     $magicianObj = new imageLib($_POST['url']);
     $magicianObj->saveImage($current_path . $_POST['path'] . $_POST['name']);
     create_img($current_path . $_POST['path'] . $_POST['name'], $thumbs_base_path . $_POST['path'] . $_POST['name'], 122, 91);
     // TODO something with this function cause its blowing my mind
     new_thumbnails_creation($current_path . $_POST['path'], $current_path . $_POST['path'] . $_POST['name'], $_POST['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option);
     break;
 case 'extract':
     if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0) {
         response('wrong path', 400)->send();
         exit;
     }
     $path = $current_path . $_POST['path'];
     $info = pathinfo($path);
     $base_folder = $current_path . fix_dirname($_POST['path']) . "/";
     switch ($info['extension']) {
         case "zip":
             $zip = new ZipArchive();
             if ($zip->open($path) === true) {
                 //make all the folders
                 for ($i = 0; $i < $zip->numFiles; $i++) {
开发者ID:kipps,项目名称:sri-lanka,代码行数:31,代码来源:ajax_calls.php

示例4: upload

 function upload()
 {
     if (!defined('FMPATH')) {
         define('FMPATH', 'public/vendor/filemanager/');
     }
     include FMPATH . 'config/config.php';
     if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") {
         die('forbiden');
     }
     include FMPATH . 'include/utils.php';
     if (isset($_POST['path'])) {
         $storeFolder = $_POST['path'];
         $storeFolderThumb = $_POST['path_thumb'];
     } else {
         $storeFolder = $current_path . $_POST["fldr"];
         // correct for when IE is in Compatibility mode
         $storeFolderThumb = $thumbs_base_path . $_POST["fldr"];
     }
     $path_pos = strpos($storeFolder, $current_path);
     $thumb_pos = strpos($storeFolderThumb, $thumbs_base_path);
     if ($path_pos !== 0 || $thumb_pos !== 0 || strpos($storeFolderThumb, '../', strlen($thumbs_base_path)) !== FALSE || strpos($storeFolderThumb, './', strlen($thumbs_base_path)) !== FALSE || strpos($storeFolder, '../', strlen($current_path)) !== FALSE || strpos($storeFolder, './', strlen($current_path)) !== FALSE) {
         die('wrong path');
     }
     $path = $storeFolder;
     $cycle = TRUE;
     $max_cycles = 50;
     $i = 0;
     while ($cycle && $i < $max_cycles) {
         $i++;
         if ($path == $current_path) {
             $cycle = FALSE;
         }
         if (file_exists($path . "config.php")) {
             require_once $path . "config.php";
             $cycle = FALSE;
         }
         $path = fix_dirname($path) . '/';
     }
     if (!empty($_FILES)) {
         $info = pathinfo($_FILES['file']['name']);
         if (in_array(fix_strtolower($info['extension']), $ext)) {
             $tempFile = $_FILES['file']['tmp_name'];
             $targetPath = $storeFolder;
             $targetPathThumb = $storeFolderThumb;
             $_FILES['file']['name'] = fix_filename($_FILES['file']['name'], $transliteration, $convert_spaces, $replace_with);
             // Gen. new file name if exists
             if (file_exists($targetPath . $_FILES['file']['name'])) {
                 $i = 1;
                 $info = pathinfo($_FILES['file']['name']);
                 // append number
                 while (file_exists($targetPath . $info['filename'] . "_" . $i . "." . $info['extension'])) {
                     $i++;
                 }
                 $_FILES['file']['name'] = $info['filename'] . "_" . $i . "." . $info['extension'];
             }
             $targetFile = $targetPath . $_FILES['file']['name'];
             $targetFileThumb = $targetPathThumb . $_FILES['file']['name'];
             // check if image (and supported)
             if (in_array(fix_strtolower($info['extension']), $ext_img)) {
                 $is_img = TRUE;
             } else {
                 $is_img = FALSE;
             }
             // upload
             move_uploaded_file($tempFile, $targetFile);
             chmod($targetFile, 0755);
             if ($is_img) {
                 $memory_error = FALSE;
                 if (!create_img($targetFile, $targetFileThumb, 122, 91)) {
                     $memory_error = FALSE;
                 } else {
                     // TODO something with this long function baaaah...
                     if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option)) {
                         $memory_error = FALSE;
                     } else {
                         $imginfo = getimagesize($targetFile);
                         $srcWidth = $imginfo[0];
                         $srcHeight = $imginfo[1];
                         // resize images if set
                         if ($image_resizing) {
                             if ($image_resizing_width == 0) {
                                 if ($image_resizing_height == 0) {
                                     $image_resizing_width = $srcWidth;
                                     $image_resizing_height = $srcHeight;
                                 } else {
                                     $image_resizing_width = $image_resizing_height * $srcWidth / $srcHeight;
                                 }
                             } elseif ($image_resizing_height == 0) {
                                 $image_resizing_height = $image_resizing_width * $srcHeight / $srcWidth;
                             }
                             // new dims and create
                             $srcWidth = $image_resizing_width;
                             $srcHeight = $image_resizing_height;
                             create_img($targetFile, $targetFile, $image_resizing_width, $image_resizing_height, $image_resizing_mode);
                         }
                         //max resizing limit control
                         $resize = FALSE;
                         if ($image_max_width != 0 && $srcWidth > $image_max_width && $image_resizing_override === FALSE) {
                             $resize = TRUE;
                             $srcWidth = $image_max_width;
//.........这里部分代码省略.........
开发者ID:nurulimamnotes,项目名称:pusakacms,代码行数:101,代码来源:Panel.php


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