本文整理匯總了PHP中ImageManager::getImagesDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageManager::getImagesDir方法的具體用法?PHP ImageManager::getImagesDir怎麽用?PHP ImageManager::getImagesDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageManager
的用法示例。
在下文中一共展示了ImageManager::getImagesDir方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: js_success
echo 'alert(\'' . $message . '\'); false';
exit;
}
function js_success($resultFile)
{
echo '\'' . $resultFile . '\'';
exit;
}
//check for img parameter in the url
if (!isset($_GET['img']) || !isset($_GET['width']) || !isset($_GET['height'])) {
js_fail('Missing parameter.');
}
$manager = new ImageManager($IMConfig);
//get the image and the full path to the image
$image = $_GET['img'];
$fullpath = Files::makeFile($manager->getImagesDir(), $image);
//not a file, so exit
if (!is_file($fullpath)) {
js_fail("File {$fullpath} does not exist.");
}
$imgInfo = @getImageSize($fullpath);
//Not an image, bail out.
if (!is_array($imgInfo)) {
js_fail("File {$fullpath} is not an image.");
}
if (!isset($_GET['to'])) {
$resized = $manager->getResizedName($fullpath, $_GET['width'], $_GET['height']);
$_GET['to'] = $manager->getResizedName($image, $_GET['width'], $_GET['height'], FALSE);
} else {
$resized = Files::makeFile($manager->getImagesDir(), $_GET['to']);
}
示例2: ImageManager
* relative to the base_dir given in config.inc.php
* @author $Author: ray $
* @version $Id: thumbs.php 761 2007-02-24 02:18:05Z ray $
* @package ImageManager
*/
require_once 'config.inc.php';
require_once 'Classes/ImageManager.php';
require_once 'Classes/Thumbnail.php';
//check for img parameter in the url
if (!isset($_GET['img'])) {
exit;
}
$manager = new ImageManager($IMConfig);
//get the image and the full path to the image
$image = rawurldecode($_GET['img']);
$fullpath = Files::makeFile($manager->getImagesDir(), $image);
//not a file, so exit
if (!is_file($fullpath)) {
exit;
}
$imgInfo = @getImageSize($fullpath);
//Not an image, send default thumbnail
if (!is_array($imgInfo)) {
//show the default image, otherwise we quit!
$default = $manager->getDefaultThumb();
if ($default) {
header('Location: ' . $default);
exit;
}
}
//if the image is less than the thumbnail dimensions