Example #1
0
/**
 * Returns the path of an image for uses in caching it
 * NOTE: character set if for the filesystem
 *
 * @param string $album album folder
 * @param string $image image file name
 * @param array $args cropping arguments
 * @return string
 */
function getImageCacheFilename($album8, $image8, $args)
{
    global $_zp_supported_images, $_zp_cachefileSuffix;
    // this function works in FILESYSTEM_CHARSET, so convert the file names
    $album = internalToFilesystem($album8);
    if (is_array($image8)) {
        $image8 = $image8['name'];
    }
    if (IMAGE_CACHE_SUFFIX) {
        $suffix = IMAGE_CACHE_SUFFIX;
    } else {
        $suffix = @$_zp_cachefileSuffix[strtoupper(getSuffix($image8))];
        if (empty($suffix)) {
            $suffix = 'jpg';
        }
    }
    if (is_array($image8)) {
        $image = internalToFilesystem($image8['name']);
    } else {
        $image = stripSuffix(internalToFilesystem($image8));
    }
    // Set default variable values.
    $postfix = getImageCachePostfix($args);
    if (empty($album)) {
        $albumsep = '';
    } else {
        if (SAFE_MODE) {
            $albumsep = SAFE_MODE_ALBUM_SEP;
            $album = str_replace(array('/', "\\"), $albumsep, $album);
        } else {
            $albumsep = '/';
        }
    }
    if (getOption('obfuscate_cache')) {
        $result = '/' . $album . $albumsep . sha1($image . HASH_SEED . $postfix) . '.' . $image . $postfix . '.' . $suffix;
    } else {
        $result = '/' . $album . $albumsep . $image . $postfix . '.' . $suffix;
    }
    return $result;
}
/**
 * Returns the path of an image for uses in caching it
 * NOTE: character set if for the filesystem
 *
 * @param string $album album folder
 * @param string $image image file name
 * @param array $args cropping arguments
 * @return string
 */
function getImageCacheFilename($album8, $image8, $args)
{
    // this function works in FILESYSTEM_CHARSET, so convert the file names
    $album = UTF8ToFilesystem($album8);
    $image = UTF8ToFilesystem($image8);
    // Set default variable values.
    $postfix = getImageCachePostfix($args);
    if (empty($album)) {
        $albumsep = '';
    } else {
        if (ini_get('safe_mode')) {
            $albumsep = SAFE_MODE_ALBUM_SEP;
            $album = str_replace(array('/', "\\"), $albumsep, $album);
        } else {
            $albumsep = '/';
        }
    }
    return '/' . $album . $albumsep . $image . $postfix . '.jpg';
}
Example #3
0
         $checked = '';
     }
 }
 $cachesizes++;
 $size = isset($cacheimage['image_size']) ? $cacheimage['image_size'] : NULL;
 $width = isset($cacheimage['image_width']) ? $cacheimage['image_width'] : NULL;
 $height = isset($cacheimage['image_height']) ? $cacheimage['image_height'] : NULL;
 $cw = isset($cacheimage['crop_width']) ? $cacheimage['crop_width'] : NULL;
 $ch = isset($cacheimage['crop_height']) ? $cacheimage['crop_height'] : NULL;
 $cx = isset($cacheimage['crop_x']) ? $cacheimage['crop_x'] : NULL;
 $cy = isset($cacheimage['crop_y']) ? $cacheimage['crop_y'] : NULL;
 $thumbstandin = isset($cacheimage['thumb']) ? $cacheimage['thumb'] : NULL;
 $effects = isset($cacheimage['gray']) ? $cacheimage['gray'] : NULL;
 $passedWM = isset($cacheimage['wmk']) ? $cacheimage['wmk'] : NULL;
 $args = array($size, $width, $height, $cw, $ch, $cx, $cy, NULL, $thumbstandin, NULL, $thumbstandin, $passedWM, NULL, $effects);
 $postfix = getImageCachePostfix($args);
 if (isset($cacheimage['maxspace']) && $cacheimage['maxspace']) {
     if ($width && $height) {
         $postfix = str_replace('_w', '_wMax', $postfix);
         $postfix = str_replace('_h', '_hMax', $postfix);
     } else {
         $postfix = '_' . gettext('invalid_MaxSpace');
         $checked = ' disabled="disabled"';
     }
 }
 $themeid = $theme = $cacheimage['theme'];
 if (isset($themes[$theme])) {
     $themeid = $themes[$theme];
 }
 if ($theme != $last && !is_array($enabled)) {
     if ($last) {
/**
 * Returns the path of an image for uses in caching it
 * NOTE: character set if for the filesystem
 *
 * @param string $album album folder
 * @param string $image image file name
 * @param array $args cropping arguments
 * @return string
 */
function getImageCacheFilename($album8, $image8, $args)
{
    global $_zp_supported_images;
    // this function works in FILESYSTEM_CHARSET, so convert the file names
    $album = internalToFilesystem($album8);
    $suffix = getSuffix($image8);
    if (!in_array($suffix, $_zp_supported_images) || $suffix == 'jpeg') {
        $suffix = 'jpg';
    }
    $image = stripSuffix(internalToFilesystem($image8));
    // Set default variable values.
    $postfix = getImageCachePostfix($args);
    if (empty($album)) {
        $albumsep = '';
    } else {
        if (ini_get('safe_mode')) {
            $albumsep = SAFE_MODE_ALBUM_SEP;
            $album = str_replace(array('/', "\\"), $albumsep, $album);
        } else {
            $albumsep = '/';
        }
    }
    if (getOption('obfuscate_cache')) {
        $result = '/' . $album . $albumsep . sha1($image . HASH_SEED . $postfix) . '.' . $suffix;
    } else {
        $result = '/' . $album . $albumsep . $image . $postfix . '.' . $suffix;
    }
    return $result;
}