本文整理汇总了PHP中getImageCacheFilename函数的典型用法代码示例。如果您正苦于以下问题:PHP getImageCacheFilename函数的具体用法?PHP getImageCacheFilename怎么用?PHP getImageCacheFilename使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getImageCacheFilename函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getImageJobStatus
/**
* @param $category
* @param $example
* @param $imageFunction
* @param \ImagickDemo\Control $control
* @param \ImagickDemo\Example $exampleController
* @internal param array $customImageParams
* @return JsonResponse
*/
public function getImageJobStatus(PageInfo $pageInfo, Control $control, Example $exampleController)
{
$data = [];
$customImageParams = $exampleController->getCustomImageParams();
$fullParams = $control->getFullParams($customImageParams);
$filename = getImageCacheFilename($pageInfo, $fullParams);
$data['filename'] = $filename;
$data['finished'] = false;
$data['params'] = $fullParams;
foreach (getKnownExtensions() as $extension) {
if (file_exists($filename . '.' . $extension) == true) {
$data['finished'] = true;
break;
}
}
return new JsonBody($data);
}
开发者ID:atawsports2,项目名称:Imagick-demos,代码行数:26,代码来源:Image.php
示例2: getCustomImage
/**
* Get a custom sized version of this image based on the parameters.
*
* @param string $alt Alt text for the url
* @param int $size size
* @param int $width width
* @param int $height height
* @param int $cropw crop width
* @param int $croph crop height
* @param int $cropx crop x axis
* @param int $cropy crop y axis
* @param string $class Optional style class
* @param string $id Optional style id
* @param bool $thumbStandin set true to inhibit watermarking
* @return string
*/
function getCustomImage($size, $width, $height, $cropw, $croph, $cropx, $cropy, $thumbStandin = false)
{
if ($thumbStandin & 1) {
if ($this->objectsThumb == NULL) {
$filename = makeSpecialImageName($this->getThumbImageFile());
$path = ZENFOLDER . '/i.php?a=' . urlencode($this->album->name) . '&i=' . urlencode($filename);
return WEBPATH . "/" . $path . ($size ? "&s={$size}" : "") . ($width ? "&w={$width}" : "") . ($height ? "&h={$height}" : "") . ($cropw ? "&cw={$cropw}" : "") . ($croph ? "&ch={$croph}" : "") . ($cropx ? "&cx={$cropx}" : "") . ($cropy ? "&cy={$cropy}" : "") . "&t=true";
} else {
$filename = $this->objectsThumb;
$wmt = getOption(get_class($this) . '_watermark');
if ($wmt) {
$wmt = '&wmt=' . $wmt;
}
$cachefilename = getImageCacheFilename($alb = $this->album->name, $filename, getImageParameters(array($size, $width, $height, $cropw, $croph, $cropx, $cropy, NULL, NULL, NULL, $thumbStandin, NULL, NULL)));
if (file_exists(SERVERCACHE . $cachefilename) && filemtime(SERVERCACHE . $cachefilename) > $this->filemtime) {
return WEBPATH . substr(CACHEFOLDER, 0, -1) . pathurlencode(imgSrcURI($cachefilename));
} else {
$path = ZENFOLDER . '/i.php?a=' . urlencode($alb) . '&i=' . urlencode($filename);
if (substr($path, 0, 1) == "/") {
$path = substr($path, 1);
}
return WEBPATH . "/" . $path . ($size ? "&s={$size}" : "") . ($width ? "&w={$width}" : "") . ($height ? "&h={$height}" : "") . ($cropw ? "&cw={$cropw}" : "") . ($croph ? "&ch={$croph}" : "") . ($cropx ? "&cx={$cropx}" : "") . ($cropy ? "&cy={$cropy}" : "") . "&t=true" . $wmt;
}
}
} else {
$filename = $this->filename;
$cachefilename = getImageCacheFilename($this->album->name, $filename, getImageParameters(array($size, $width, $height, $cropw, $croph, $cropx, $cropy, NULL, NULL, NULL, $thumbStandin, NULL, NULL)));
if (file_exists(SERVERCACHE . $cachefilename) && filemtime(SERVERCACHE . $cachefilename) > $this->filemtime) {
return WEBPATH . substr(CACHEFOLDER, 0, -1) . pathurlencode(imgSrcURI($cachefilename));
} else {
return WEBPATH . '/' . ZENFOLDER . '/i.php?a=' . urlencode($this->album->name) . '&i=' . urlencode($filename) . ($size ? "&s={$size}" : "") . ($width ? "&w={$width}" : "") . ($height ? "&h={$height}" : "") . ($cropw ? "&cw={$cropw}" : "") . ($croph ? "&ch={$croph}" : "") . ($cropx ? "&cx={$cropx}" : "") . ($cropy ? "&cy={$cropy}" : "");
}
}
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:50,代码来源:class-video.php
示例3: getImageURI
/**
*
* Returns an URI to the image:
*
* If the image is not cached, the uri will be to the image processor
* If the image is cached then the uri will depend on the site option for
* cache serving. If the site is set for open cache the uri will point to
* the cached image. If the site is set for protected cache the uri will
* point to the image processor (which will serve the image from the cache.)
* NOTE: this latter implies added overhead for each and every image fetch!
*
* @param array $args
* @param string $album the album name
* @param string $image the image name
* @param int $mitme mtime of the image
* @return string
*/
function getImageURI($args, $album, $image, $mtime)
{
$cachefilename = getImageCacheFilename($album, $image, $args);
if (OPEN_IMAGE_CACHE && file_exists(SERVERCACHE . $cachefilename) && (!$mtime || filemtime(SERVERCACHE . $cachefilename) >= $mtime)) {
return WEBPATH . '/' . CACHEFOLDER . imgSrcURI($cachefilename);
} else {
return getImageProcessorURI($args, $album, $image);
}
}
开发者ID:rb26,项目名称:zenphoto,代码行数:26,代码来源:functions-basic.php
示例4: getProtectedImageURL
/**
* Returns an url to the password protected/watermarked current image
*
* @param object $image optional image object overrides the current image
* @param string $disposal set to override the 'protect_full_image' option
* @return string
* */
function getProtectedImageURL($image = NULL, $disposal = NULL)
{
global $_zp_current_image;
if (is_null($disposal)) {
$disposal = getOption('protect_full_image');
}
if ($disposal == 'No access') {
return NULL;
}
if (is_null($image)) {
if (!in_context(ZP_IMAGE)) {
return false;
}
if (is_null($_zp_current_image)) {
return false;
}
$image = $_zp_current_image;
}
$album = $image->getAlbum();
$watermark_use_image = getWatermarkParam($image, WATERMARK_FULL);
if (!empty($watermark_use_image)) {
$wmt = $watermark_use_image;
} else {
$wmt = false;
}
$args = array('FULL', NULL, NULL, NULL, NULL, NULL, NULL, (int) getOption('full_image_quality'), NULL, NULL, NULL, $wmt, false, NULL, NULL);
$cache_file = getImageCacheFilename($album->name, $image->filename, $args);
$cache_path = SERVERCACHE . $cache_file;
if ($disposal != 'Download' && OPEN_IMAGE_CACHE && file_exists($cache_path)) {
return WEBPATH . '/' . CACHEFOLDER . pathurlencode(imgSrcURI($cache_file));
} else {
if ($disposal == 'Unprotected') {
return getImageURI($args, $album->name, $image->filename, $image->filemtime);
} else {
$params = '&q=' . getOption('full_image_quality');
if (!empty($watermark_use_image)) {
$params .= '&wmk=' . $watermark_use_image;
}
if ($disposal) {
$params .= '&dsp=' . $disposal;
}
$params .= '&check=' . sha1(HASH_SEED . serialize($args));
if (is_array($image->filename)) {
$album = dirname($image->filename['source']);
$image = basename($image->filename['source']);
} else {
$album = $album->name;
$image = $image->filename;
}
return WEBPATH . '/' . ZENFOLDER . '/full-image.php?a=' . $album . '&i=' . $image . $params;
}
}
}
开发者ID:IliyanGochev,项目名称:zenphoto,代码行数:60,代码来源:template-functions.php
示例5: html_encode
if (isset($args[10])) {
echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="15" width="15" alt="x" />' . "\n";
} else {
echo '<img src="' . html_encode(pathurlencode($uri)) . '" height="20" width="20" alt="X" />' . "\n";
}
?>
</a>
<?php
}
break;
}
}
if ($missing) {
recordMissing($table, $row, $image);
}
$cache_file = '{*WEBPATH*}/' . CACHEFOLDER . getImageCacheFilename(dirname($image), basename($image), $args);
if ($match != $cache_file) {
//need to update the record.
$row[$field] = updateCacheName($row[$field], $match, $cache_file);
$updated = true;
}
}
}
if ($updated) {
$sql = 'UPDATE ' . prefix($table) . ' SET `' . $field . '`=' . db_quote($row[$field]) . ' WHERE `id`=' . $row['id'];
query($sql);
}
}
}
}
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:cacheDBImages.php
示例6: directCustomImageCallable
function directCustomImageCallable(PageInfo $pageInfo, \Auryn\Injector $injector, $params)
{
$imageFunction = CategoryInfo::getCustomImageFunctionName($pageInfo);
$filename = getImageCacheFilename($pageInfo, $params);
global $imageType;
ob_start();
$injector->execute($imageFunction);
if ($imageType == null) {
ob_end_clean();
throw new \Exception("imageType not set, can't cache image correctly.");
}
$imageData = ob_get_contents();
ob_end_clean();
return new DataBody($filename, $imageData, "image/" . $imageType);
}
开发者ID:finelinePG,项目名称:imagick,代码行数:15,代码来源:appFunctions.php
示例7: getImageParameters
$args[] = $adminrequest;
//12
$args = getImageParameters($args);
list($size, $width, $height, $cw, $ch, $cx, $cy, $quality, $thumb, $crop, $thumbstandin, $thumbWM, $adminrequest) = $args;
$allowWatermark = !$thumb && !$adminrequest;
if ($debug) {
imageDebug($album, $image, $args);
}
} else {
// No image parameters specified or are out of bounds; return the original image.
//TODO: this will fail when the album folder is external to zp. Maybe should force the sizes within bounds.
header("Location: " . getAlbumFolder(FULLWEBPATH) . pathurlencode(FilesystemToUTF8($album)) . "/" . rawurlencode(filesystemToUTF8($image)));
return;
}
// Construct the filename to save the cached image.
$newfilename = getImageCacheFilename(FilesystemToUTF8($album), filesystemToUTF8($image), $args);
$newfile = SERVERCACHE . $newfilename;
if (trim($album) == '') {
$imgfile = getAlbumFolder() . $image;
} else {
$imgfile = getAlbumFolder() . $album . '/' . $image;
}
/** Check for possible problems ***********
******************************************/
// Make sure the cache directory is writable, attempt to fix. Issue a warning if not fixable.
if (!is_dir(SERVERCACHE)) {
@mkdir(SERVERCACHE, CHMOD_VALUE);
@chmod(SERVERCACHE, CHMOD_VALUE);
if (!is_dir(SERVERCACHE)) {
imageError(gettext("The cache directory does not exist. Please create it and set the permissions to 0777."), 'err-cachewrite.gif');
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:31,代码来源:i.php
示例8: getImageJobStatus
/**
* @param $category
* @param $example
* @param $imageFunction
* @param \ImagickDemo\Control $control
* @param \ImagickDemo\Example $exampleController
* @internal param array $customImageParams
* @return JsonResponse
*/
function getImageJobStatus($category, $example, $imageFunction, \ImagickDemo\Control $control, \ImagickDemo\Example $exampleController)
{
$data = [];
$customImageParams = $exampleController->getCustomImageParams();
$fullParams = $control->getFullParams($customImageParams);
$filename = getImageCacheFilename($category, $example, $fullParams);
$data['filename'] = $filename;
$data['finished'] = false;
$data['params'] = $fullParams;
foreach (getKnownExtensions() as $extension) {
if (file_exists($filename . '.' . $extension) == true) {
$data['finished'] = true;
break;
}
}
return new JsonResponse($data);
}
开发者ID:sdmmember,项目名称:Imagick-demos,代码行数:26,代码来源:Image.php
示例9: getThumb
/**
* Get a default-sized thumbnail of this image.
*
* @return string
*/
function getThumb($type = 'image')
{
$ts = getOption('thumb_size');
if (getOption('thumb_crop')) {
list($custom, $sw, $sh, $cw, $ch, $cx, $cy) = $this->getThumbCropping($type);
if ($custom) {
return $this->getCustomImage(NULL, $sw, $sh, $cw, $ch, $cx, $cy, true);
}
} else {
$sw = $sh = NULL;
}
$filename = $this->filename;
$wmt = getWatermarkParam($this, WATERMARK_THUMB);
$args = getImageParameters(array($ts, NULL, NULL, $sw, $sh, NULL, NULL, NULL, true, NULL, true, $wmt, NULL, NULL), $this->album->name);
$cachefilename = getImageCacheFilename($alb = $this->album->name, $filename, $args);
if (file_exists(SERVERCACHE . $cachefilename) && filemtime(SERVERCACHE . $cachefilename) > $this->filemtime) {
return WEBPATH . '/' . CACHEFOLDER . pathurlencode(imgSrcURI($cachefilename));
} else {
return getImageProcessorURI($args, $this->album->name, $this->filename);
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:26,代码来源:class-image.php
示例10: header
}
if (!isset($_GET['s']) && !isset($_GET['w']) && !isset($_GET['h'])) {
// No image parameters specified
if (getOption('album_folder_class') !== 'external') {
header("Location: " . getAlbumFolder(FULLWEBPATH) . pathurlencode(filesystemToInternal($album)) . "/" . rawurlencode(filesystemToInternal($image)));
return;
}
}
$args = getImageParameters($args, filesystemToInternal($album));
list($size, $width, $height, $cw, $ch, $cx, $cy, $quality, $thumb, $crop, $thumbstandin, $passedWM, $adminrequest, $effects) = $args;
if (DEBUG_IMAGE) {
debugLog("i.php({$ralbum}, {$rimage}): \$size={$size}, \$width={$width}, \$height={$height}, \$cw={$cw}, \$ch={$ch}, \$cx={$cx}, \$cy={$cy}, \$quality={$quality}, \$thumb={$thumb}, \$crop={$crop}, \$thumbstandin={$thumbstandin}, \$passedWM={$passedWM}, \$adminrequest={$adminrequest}, \$effects={$effects}");
}
$allowWatermark = !$thumb && !$adminrequest;
// Construct the filename to save the cached image.
$newfilename = getImageCacheFilename(filesystemToInternal($album), filesystemToInternal($image), $args);
$newfile = SERVERCACHE . $newfilename;
if (trim($album) == '') {
$imgfile = ALBUM_FOLDER_SERVERPATH . $image;
} else {
$imgfile = ALBUM_FOLDER_SERVERPATH . $album . '/' . $image;
}
if ($debug) {
imageDebug($album, $image, $args, $imgfile);
}
/** Check for possible problems ***********
* **************************************** */
// Make sure the cache directory is writable, attempt to fix. Issue a warning if not fixable.
if (!is_dir(SERVERCACHE)) {
@mkdir(SERVERCACHE, FOLDER_MOD);
@chmod(SERVERCACHE, FOLDER_MOD);
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:i.php
示例11: getFilename
public function getFilename()
{
return getImageCacheFilename($this->pageInfo, $this->params);
}
开发者ID:atawsports2,项目名称:Imagick-demos,代码行数:4,代码来源:ImagickTask.php
示例12: getThumb
/**
* returns a link to the thumbnail for the text file.
*
* @param string $type 'image' or 'album'
* @return string
*/
function getThumb($type = 'image')
{
$ts = getOption('thumb_size');
$sw = getOption('thumb_crop_width');
$sh = getOption('thumb_crop_height');
list($custom, $cw, $ch, $cx, $cy) = $this->getThumbCropping($ts, $sw, $sh);
$wmt = $this->watermark;
if (empty($wmt)) {
$wmt = getWatermarkParam($this, WATERMARK_THUMB);
}
if (is_null($this->objectsThumb)) {
$mtime = $cx = $cy = NULL;
$filename = makeSpecialImageName($this->getThumbImageFile());
if (!$this->watermarkDefault) {
$wmt = '!';
}
} else {
$filename = filesystemToInternal($this->objectsThumb);
$mtime = filemtime(ALBUM_FOLDER_SERVERPATH . '/' . internalToFilesystem($this->imagefolder) . '/' . $this->objectsThumb);
}
$args = getImageParameters(array($ts, $sw, $sh, $cw, $ch, $cx, $cy, NULL, true, true, true, $wmt, NULL, NULL), $this->album->name);
$cachefilename = getImageCacheFilename($alb = $this->album->name, $this->filename, $args);
return getImageURI($args, $alb, $filename, $mtime);
}
开发者ID:rb26,项目名称:zenphoto,代码行数:30,代码来源:class-textobject_core.php
示例13: getCustomImage
/**
* Get a custom sized version of this image based on the parameters.
*
* @param string $alt Alt text for the url
* @param int $size size
* @param int $width width
* @param int $height height
* @param int $cropw crop width
* @param int $croph crop height
* @param int $cropx crop x axis
* @param int $cropy crop y axis
* @param string $class Optional style class
* @param string $id Optional style id
* @param bool $thumbStandin set to true to treat as thumbnail
* @param bool $effects ignored
* @return string
*/
function getCustomImage($size, $width, $height, $cropw, $croph, $cropx, $cropy, $thumbStandin = false, $effects = NULL)
{
if ($thumbStandin) {
$wmt = getOption('Video_watermark');
if (empty($wmt)) {
$wmt = getWatermarkParam($this, WATERMARK_THUMB);
}
} else {
$wmt = NULL;
}
$args = getImageParameters(array($size, $width, $height, $cropw, $croph, $cropx, $cropy, NULL, $thumbStandin, NULL, $thumbStandin, $wmt, NULL, $effects), $this->album->name);
if ($thumbStandin & 1) {
if ($this->objectsThumb == NULL) {
$filename = makeSpecialImageName($this->getThumbImageFile());
if (!getOption('video_watermark_default_images')) {
$args[11] = '!';
}
return getImageProcessorURI($args, $this->album->name, $filename);
} else {
$filename = $this->objectsThumb;
$cachefilename = getImageCacheFilename($alb = $this->album->name, $filename, getImageParameters(array($size, $width, $height, $cropw, $croph, $cropx, $cropy, NULL, $thumbStandin, NULL, $thumbStandin, NULL, NULL, NULL)), $this->album->name);
if (file_exists(SERVERCACHE . $cachefilename) && filemtime(SERVERCACHE . $cachefilename) > $this->filemtime) {
return WEBPATH . '/' . CACHEFOLDER . pathurlencode(imgSrcURI($cachefilename));
} else {
return getImageProcessorURI($args, $this->album->name, $filename);
}
}
} else {
$filename = $this->filename;
$cachefilename = getImageCacheFilename($this->album->name, $filename, $args);
if (file_exists(SERVERCACHE . $cachefilename) && filemtime(SERVERCACHE . $cachefilename) > $this->filemtime) {
return WEBPATH . '/' . CACHEFOLDER . pathurlencode(imgSrcURI($cachefilename));
} else {
return getImageProcessorURI($args, $this->album->name, $filename);
}
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:54,代码来源:class-video.php
示例14: create
/**
* @param $category
* @param $example
* @param $imageFunction
* @param $params
* @return ImagickTask
*/
public static function create($category, $example, $imageFunction, $params)
{
$filename = getImageCacheFilename($category, $example, $params);
return new \ImagickDemo\Queue\ImagickTask($imageFunction, $params, $filename);
}
开发者ID:sdmmember,项目名称:Imagick-demos,代码行数:12,代码来源:ImagickTask.php
示例15: getProtectedImageURL
/**
* Returns an url to the password protected/watermarked current image
*
* @param object $image optional image object overrides the current image
* @param string $disposal set to override the 'protect_full_image' option
* @return string
**/
function getProtectedImageURL($image = NULL, $disposal = NULL)
{
global $_zp_current_image;
if ($disposal == 'No access') {
return NULL;
}
if (is_null($image)) {
if (!in_context(ZP_IMAGE)) {
return false;
}
if (is_null($_zp_current_image)) {
return false;
}
$image = $_zp_current_image;
}
$album = $image->getAlbum();
$wmt = $image->getWatermark();
if (!empty($wmt) || !($image->getWMUse() & WATERMARK_FULL)) {
$wmt = NULL;
}
$args = array('FULL', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $wmt, NULL);
$cache_file = getImageCacheFilename($album->name, $image->filename, $args);
$cache_path = SERVERCACHE . $cache_file;
if (empty($disposal) && file_exists($cache_path)) {
return WEBPATH . '/' . CACHEFOLDER . pathurlencode(imgSrcURI($cache_file));
} else {
$params = '&q=' . getOption('full_image_quality');
$watermark_use_image = getWatermarkParam($image, WATERMARK_FULL);
if (!empty($watermark_use_image)) {
$params .= '&wmk=' . $watermark_use_image;
}
if ($disposal) {
$params .= '&dsp=' . $disposal;
}
return WEBPATH . '/' . ZENFOLDER . '/full-image.php?a=' . urlencode($album->name) . '&i=' . urlencode($image->filename) . $params;
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:44,代码来源:template-functions.php
示例16: PageInfo
$injector->alias(\ImagickDemo\Navigation\Nav::class, \ImagickDemo\Navigation\CategoryNav::class);
$pageInfo = new PageInfo($category, $functionName);
$injector->share($pageInfo);
$categoryNav = $injector->make(\ImagickDemo\Navigation\CategoryNav::class);
$exampleDefinition = CategoryNav::getExampleDefinition($category, $functionName);
$function = $exampleDefinition[0];
$controlClass = $exampleDefinition[1];
if (array_key_exists('defaultParams', $exampleDefinition) == true) {
foreach ($exampleDefinition['defaultParams'] as $name => $value) {
$defaultName = 'default' . ucfirst($name);
$injector->defineParam($defaultName, $value);
}
}
createControl($categoryNav, $injector);
$pageInfo = new \ImagickDemo\Helper\PageInfo($category, $functionName);
$filename = getImageCacheFilename($pageInfo, $params);
$extensions = [".jpg", '.jpeg', ".gif", ".png"];
$fileExtension = false;
foreach ($extensions as $extension) {
$filenameWithExtension = $filename . $extension;
if (file_exists($filenameWithExtension) == true) {
$fileExtension = $extension;
}
}
if ($fileExtension === false) {
echo "File {$filename} does not exist creating.\n";
generateCompare($injector, $functionFullname, $filename);
} else {
compareFile($injector, $functionFullname, $filename, $fileExtension);
}
}
开发者ID:finelinePG,项目名称:imagick,代码行数:31,代码来源:compare.php
示例17: fopen
// enable this to make the image a download
$fp = fopen($image_path, 'rb');
// send the right headers
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header("Content-Type: {$mimetype}");
header("Content-Length: " . filesize($image_path));
// dump the picture and stop the script
fpassthru($fp);
fclose($fp);
} else {
header('Location: ' . $imageobj->getFullImageURL(), true, 301);
}
exitZP();
}
if ($force_cache = getOption('cache_full_image')) {
$cache_file = getImageCacheFilename($album, $image, $args);
$cache_path = SERVERCACHE . $cache_file;
mkdir_recursive(dirname($cache_path), FOLDER_MOD);
} else {
$cache_file = $album . "/" . stripSuffix($image) . '_FULL.' . $suffix;
$cache_path = NULL;
}
$process = $rotate = false;
if (zp_imageCanRotate()) {
$rotate = getImageRotation($imageobj);
$process = $rotate;
}
$watermark_use_image = getWatermarkParam($imageobj, WATERMARK_FULL);
if ($watermark_use_image == NO_WATERMARK) {
$watermark_use_image = '';
} else {
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:full-image.php
示例18: getThumb
/**
* Get a default-sized thumbnail of this image.
*
* @return string
*/
function getThumb($type = 'image')
{
if (getOption('thumb_crop') && !is_null($cy = $this->get('thumbY'))) {
$ts = getOption('thumb_size');
$sw = getOption('thumb_crop_width');
$sh = getOption('thumb_crop_height');
$cx = $this->get('thumbX');
$cw = $this->get('thumbW');
$ch = $this->get('thumbH');
// upscale to thumb_size proportions
if ($sw == $sh) {
// square crop, set the size/width to thumbsize
$sw = $sh = $ts;
} else {
if ($sw > $sh) {
$r = $ts / $sw;
$sw = $ts;
$sh = $sh * $r;
} else {
$r = $ts / $sh;
$sh = $ts;
$sh = $r * $sh;
}
}
return $this->getCustomImage(NULL, $sw, $sh, $cw, $ch, $cx, $cy, true);
}
$filename = $this->filename;
$wmt = getOption('Image_watermark');
if ($wmt) {
$wmt = '&wmt=' . $wmt;
}
$cachefilename = getImageCacheFilename($alb = $this->album->name, $filename, getImageParameters(array('thumb')));
if (file_exists(SERVERCACHE . $cachefilename) && filemtime(SERVERCACHE . $cachefilename) > $this->filemtime) {
return WEBPATH . substr(CACHEFOLDER, 0, -1) . pathurlencode(imgSrcURI($cachefilename));
} else {
if (getOption('mod_rewrite') && empty($wmt) && !empty($alb)) {
$path = pathurlencode($alb) . '/' . $type . '/thumb/' . urlencode($filename);
} else {
$path = ZENFOLDER . '/i.php?a=' . urlencode($this->album->name) . '&i=' . urlencode($filename) . '&s=thumb' . $wmt;
if ($type !== 'image') {
$path .= '&' . $type . '=true';
}
}
if (substr($path, 0, 1) == "/") {
$path = substr($path, 1);
}
return WEBPATH . "/" . $path;
}
}
开发者ID:ItsHaden,项目名称:epicLanBootstrap,代码行数:54,代码来源:class-image.php
示例19: foreach
$injector->defineParam($name, $value);
}
$injector->alias(\ImagickDemo\Navigation\Nav::class, \ImagickDemo\Navigation\CategoryNav::class);
$injector->define(\ImagickDemo\Navigation\CategoryNav::class, [':category' => $category, ':example' => $functionName]);
$categoryNav = $injector->make(\ImagickDemo\Navigation\CategoryNav::class);
$exampleDefinition = $categoryNav->getExampleDefinition($category, $functionName);
$function = $exampleDefinition[0];
$controlClass = $exampleDefinition[1];
if (array_key_exists('defaultParams', $exampleDefinition) == true) {
foreach ($exampleDefinition['defaultParams'] as $name => $value) {
$defaultName = 'default' . ucfirst($name);
$injector->defineParam($defaultName, $value);
}
}
//delegateAllTheThings($injector, $controlClass);
$filename = getImageCacheFilename($category, $functionName . ".compare", $params);
$extensions = [".jpg", '.jpeg', ".gif", ".png"];
$fileExtension = false;
foreach ($extensions as $extension) {
$filenameWithExtension = $filename . $extension;
if (file_exists($filenameWithExtension) == true) {
$fileExtension = $extension;
}
}
if ($fileExtension === false) {
echo "File {$filename} does not exist creating.\n";
generateCompare($injector, $functionFullname, $filename);
} else {
compareFile($injector, $functionFullname, $filename, $fileExtension);
}
}
开发者ID:sdmmember,项目名称:Imagick-demos,代码行数:31,代码来源:compare.php
示例20: getCachedImageResponse
/**
* @param $category
* @param $example
* @param \ImagickDemo\Control $control
* @return mixed
*/
function getCachedImageResponse($category, $example, $params)
{
$filename = getImageCacheFilename($category, $example, $params);
return createFileResponseIfFileExists($filename);
}
开发者ID:sdmmember,项目名称:Imagick-demos,代码行数:11,代码来源:bootstrap.php
注:本文中的getImageCacheFilename函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论