本文整理汇总了PHP中eZIEImageToolResize类的典型用法代码示例。如果您正苦于以下问题:PHP eZIEImageToolResize类的具体用法?PHP eZIEImageToolResize怎么用?PHP eZIEImageToolResize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了eZIEImageToolResize类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eZIEImagePreAction
<?php
/**
* File containing the pixelate tool handler
*
* @copyright Copyright (C) eZ Systems AS.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version //autogentag//
* @package ezie
*/
$prepare_action = new eZIEImagePreAction();
$http = eZHTTPTool::instance();
$region = null;
if ($prepare_action->hasRegion()) {
$region = $prepare_action->getRegion();
}
// retrieve image dimensions
$analyzer = new eZIEImageAnalyzer($prepare_action->getImagePath());
$imageconverter = new eZIEezcImageConverter(eZIEImageToolPixelate::filter($analyzer->data->width, $analyzer->data->height, $region));
$imageconverter->perform($prepare_action->getImagePath(), $prepare_action->getNewImagePath());
eZIEImageToolResize::doThumb($prepare_action->getNewImagePath(), $prepare_action->getNewThumbnailPath());
echo (string) $prepare_action;
eZExecution::cleanExit();
示例2: basename
$working_folder_path = eZSys::cacheDirectory() . '/public/ezie/' . $user->id() . "/{$attributeID}-{$version}";
$working_folder_absolute_path = eZSys::rootDir() . "/{$working_folder_path}";
$handler = eZClusterFileHandler::instance();
if (!$handler->fileExists($working_folder_absolute_path)) {
// @todo DB Based handlers have no knowledge of folders !
$res = eZDir::mkdir($working_folder_absolute_path, false, true);
}
// Copy the original file in the temp directory
// $work_folder/{history_id}-{file_name}
// (thumb: $working_folder/thumb_{history_id}-{file_name}
$file = "0-" . basename($image_path);
$thumb = "thumb-{$file}";
// @todo Manage possible errors
$handler->fileCopy($image_path, "{$working_folder_path}/{$file}");
// Creation of a thumbnail
eZIEImageToolResize::doThumb("{$working_folder_path}/{$file}", "{$working_folder_path}/{$thumb}");
// retrieve image dimensions
$ezcanalyzer = new eZIEImageAnalyzer("{$working_folder_path}/{$file}", false);
$object = new stdClass();
$imageURI = "{$working_folder_path}/{$file}";
eZURI::transformURI($imageURI, true);
$thumbnailURI = "{$working_folder_path}/{$thumb}";
eZURI::transformURI($thumbnailURI, true);
$moduleURI = 'ezie';
eZURI::transformURI($moduleURI, false);
$object->thumbnail_url = $thumbnailURI;
$object->image_url = $imageURI;
// the key is the folder where the working image is stored
$object->key = $user->id() . "/{$attributeID}-{$version}";
$object->image_id = (int) $attributeID;
$object->image_version = (int) $version;