mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-04 15:17:42 +02:00
Add png compression to generated cache filename, fix #103.
This commit is contained in:
27
CImage.php
27
CImage.php
@@ -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.
|
* Allow or disallow remote image download.
|
||||||
*
|
*
|
||||||
@@ -1244,8 +1265,10 @@ class CImage
|
|||||||
$file = $subdir . '_' . $parts['filename'] . '_' . $width . '_'
|
$file = $subdir . '_' . $parts['filename'] . '_' . $width . '_'
|
||||||
. $height . $offset . $crop . $cropToFit . $fillToFit
|
. $height . $offset . $crop . $cropToFit . $fillToFit
|
||||||
. $crop_x . $crop_y . $upscale
|
. $crop_x . $crop_y . $upscale
|
||||||
. $quality . $filters . $sharpen . $emboss . $blur . $palette . $optimize
|
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
||||||
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor . $convolve
|
. $optimize . $compress
|
||||||
|
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
||||||
|
. $convolve
|
||||||
. $extension;
|
. $extension;
|
||||||
|
|
||||||
return $this->setTarget($file, $base);
|
return $this->setTarget($file, $base);
|
||||||
|
@@ -5,6 +5,12 @@ Revision history
|
|||||||
[](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
|
[](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
|
||||||
|
|
||||||
|
|
||||||
|
v0.7.5x (latest)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Add option for png compression to generade filename, fix #103.
|
||||||
|
|
||||||
|
|
||||||
v0.7.4 (2015-09-15)
|
v0.7.4 (2015-09-15)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user