mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-06 16:16:39 +02:00
refixing new cache management for remote images
This commit is contained in:
15
CImage.php
15
CImage.php
@@ -358,6 +358,13 @@ class CImage
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Path to cache for remote download.
|
||||
*/
|
||||
private $remoteCache;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Pattern to recognize a remote file.
|
||||
*/
|
||||
@@ -400,7 +407,7 @@ class CImage
|
||||
*/
|
||||
const RESIZE = 1;
|
||||
const RESAMPLE = 2;
|
||||
private $copyStrategy = null;
|
||||
private $copyStrategy = NULL;
|
||||
|
||||
|
||||
|
||||
@@ -1634,7 +1641,7 @@ class CImage
|
||||
*/
|
||||
public function imageCopyResampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
|
||||
{
|
||||
if ($this->copyStrategy == self::RESIZE) {
|
||||
if($this->copyStrategy == self::RESIZE) {
|
||||
$this->log("Copy by resize");
|
||||
imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||
} else {
|
||||
@@ -2312,7 +2319,7 @@ class CImage
|
||||
|
||||
$type = $this->getTargetImageExtension();
|
||||
$this->Log("Saving image as " . $type);
|
||||
switch ($type) {
|
||||
switch($type) {
|
||||
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
@@ -2549,7 +2556,7 @@ class CImage
|
||||
header('Last-Modified: ' . $gmdate . " GMT");
|
||||
}
|
||||
|
||||
foreach ($this->HTTPHeader as $key => $val) {
|
||||
foreach($this->HTTPHeader as $key => $val) {
|
||||
header("$key: $val");
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,7 @@ class CRemoteImage
|
||||
*/
|
||||
public function setCache($path)
|
||||
{
|
||||
$this->saveFolder = $path;
|
||||
$this->saveFolder = rtrim($path, "/") . "/";
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user