1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-07-30 21:20:11 +02:00

Add png compression to generated cache filename, fix #103.

This commit is contained in:
Mikael Roos
2015-09-16 09:51:04 +02:00
parent ea4794f4a2
commit fd2ddadc44
2 changed files with 31 additions and 2 deletions

View File

@@ -417,6 +417,27 @@ class CImage
/**
* Create and save a dummy image.
*
* @param boolean $allow true or false to enable and disable.
* @param string $pattern to use to detect if its a remote file.
*
* @return $this
*/
public function createDummyImage($width = 100, $height = 100)
{
$img = $this->CreateImageKeepTransparency($width, $height);
$this->generateFilename($cachePath);
$this->save();
return $this;
}
/**
* Allow or disallow remote image download.
*
@@ -1244,8 +1265,10 @@ class CImage
$file = $subdir . '_' . $parts['filename'] . '_' . $width . '_'
. $height . $offset . $crop . $cropToFit . $fillToFit
. $crop_x . $crop_y . $upscale
. $quality . $filters . $sharpen . $emboss . $blur . $palette . $optimize
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor . $convolve
. $quality . $filters . $sharpen . $emboss . $blur . $palette
. $optimize . $compress
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
. $convolve
. $extension;
return $this->setTarget($file, $base);