1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-03 06:37:41 +02:00

add srgb as part of cache filename

This commit is contained in:
Mikael Roos
2015-10-24 16:42:59 +02:00
parent 7a98a44dd4
commit 0efcfd5bc7

View File

@@ -1298,10 +1298,11 @@ class CImage
* @param string $base as optional basepath for storing file. * @param string $base as optional basepath for storing file.
* @param boolean $useSubdir use or skip the subdir part when creating the * @param boolean $useSubdir use or skip the subdir part when creating the
* filename. * filename.
* @param string $prefix to add as part of filename
* *
* @return $this * @return $this
*/ */
public function generateFilename($base = null, $useSubdir = true) public function generateFilename($base = null, $useSubdir = true, $prefix = null)
{ {
$filename = basename($this->pathToImage); $filename = basename($this->pathToImage);
$cropToFit = $this->cropToFit ? '_cf' : null; $cropToFit = $this->cropToFit ? '_cf' : null;
@@ -1374,7 +1375,7 @@ class CImage
$subdir .= '_'; $subdir .= '_';
} }
$file = $subdir . $filename . $width . $height $file = $prefix . $subdir . $filename . $width . $height
. $offset . $crop . $cropToFit . $fillToFit . $offset . $crop . $cropToFit . $fillToFit
. $crop_x . $crop_y . $upscale . $crop_x . $crop_y . $upscale
. $quality . $filters . $sharpen . $emboss . $blur . $palette . $quality . $filters . $sharpen . $emboss . $blur . $palette
@@ -2424,7 +2425,7 @@ class CImage
// Prepare // Prepare
$this->setSaveFolder($cache) $this->setSaveFolder($cache)
->setSource($src, $dir) ->setSource($src, $dir)
->generateFilename(null, false); ->generateFilename(null, false, 'srgb_');
// Check if the cached version is accurate. // Check if the cached version is accurate.
if ($useCache && is_readable($this->cacheFileName)) { if ($useCache && is_readable($this->cacheFileName)) {