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


PHP getImageCacheFilename函数代码示例

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


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


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