mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-04 23:27:43 +02:00
recreating bundles
This commit is contained in:
@@ -430,7 +430,7 @@ class CRemoteImage
|
|||||||
*/
|
*/
|
||||||
public function setCache($path)
|
public function setCache($path)
|
||||||
{
|
{
|
||||||
$this->saveFolder = $path;
|
$this->saveFolder = rtrim($path, "/") . "/";
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1132,8 +1132,8 @@ class CImage
|
|||||||
/**
|
/**
|
||||||
* Path to command to optimize jpeg images, for example jpegtran or null.
|
* Path to command to optimize jpeg images, for example jpegtran or null.
|
||||||
*/
|
*/
|
||||||
private $jpegOptimize;
|
private $jpegOptimize;
|
||||||
private $jpegOptimizeCmd;
|
private $jpegOptimizeCmd;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1268,20 +1268,27 @@ class CImage
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate target dimension for image when using fill-to-fit resize strategy.
|
* Calculate target dimension for image when using fill-to-fit resize strategy.
|
||||||
*/
|
*/
|
||||||
private $fillWidth;
|
private $fillWidth;
|
||||||
private $fillHeight;
|
private $fillHeight;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow remote file download, default is to disallow remote file download.
|
* Allow remote file download, default is to disallow remote file download.
|
||||||
*/
|
*/
|
||||||
private $allowRemote = false;
|
private $allowRemote = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to cache for remote download.
|
||||||
|
*/
|
||||||
|
private $remoteCache;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pattern to recognize a remote file.
|
* Pattern to recognize a remote file.
|
||||||
*/
|
*/
|
||||||
@@ -1324,7 +1331,7 @@ class CImage
|
|||||||
*/
|
*/
|
||||||
const RESIZE = 1;
|
const RESIZE = 1;
|
||||||
const RESAMPLE = 2;
|
const RESAMPLE = 2;
|
||||||
private $copyStrategy = null;
|
private $copyStrategy = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1555,7 +1562,7 @@ class CImage
|
|||||||
|
|
||||||
if ($extension == 'jpeg') {
|
if ($extension == 'jpeg') {
|
||||||
$extension = 'jpg';
|
$extension = 'jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $extension;
|
return $extension;
|
||||||
}
|
}
|
||||||
@@ -2543,11 +2550,11 @@ class CImage
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCopyResizeStrategy($strategy)
|
public function setCopyResizeStrategy($strategy)
|
||||||
{
|
{
|
||||||
$this->copyStrategy = $strategy;
|
$this->copyStrategy = $strategy;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2558,7 +2565,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)
|
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");
|
$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);
|
imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||||
} else {
|
} else {
|
||||||
@@ -3236,7 +3243,7 @@ class CImage
|
|||||||
|
|
||||||
$type = $this->getTargetImageExtension();
|
$type = $this->getTargetImageExtension();
|
||||||
$this->Log("Saving image as " . $type);
|
$this->Log("Saving image as " . $type);
|
||||||
switch ($type) {
|
switch($type) {
|
||||||
|
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
@@ -3473,7 +3480,7 @@ class CImage
|
|||||||
header('Last-Modified: ' . $gmdate . " GMT");
|
header('Last-Modified: ' . $gmdate . " GMT");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->HTTPHeader as $key => $val) {
|
foreach($this->HTTPHeader as $key => $val) {
|
||||||
header("$key: $val");
|
header("$key: $val");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -430,7 +430,7 @@ class CRemoteImage
|
|||||||
*/
|
*/
|
||||||
public function setCache($path)
|
public function setCache($path)
|
||||||
{
|
{
|
||||||
$this->saveFolder = $path;
|
$this->saveFolder = rtrim($path, "/") . "/";
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1132,8 +1132,8 @@ class CImage
|
|||||||
/**
|
/**
|
||||||
* Path to command to optimize jpeg images, for example jpegtran or null.
|
* Path to command to optimize jpeg images, for example jpegtran or null.
|
||||||
*/
|
*/
|
||||||
private $jpegOptimize;
|
private $jpegOptimize;
|
||||||
private $jpegOptimizeCmd;
|
private $jpegOptimizeCmd;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1268,20 +1268,27 @@ class CImage
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate target dimension for image when using fill-to-fit resize strategy.
|
* Calculate target dimension for image when using fill-to-fit resize strategy.
|
||||||
*/
|
*/
|
||||||
private $fillWidth;
|
private $fillWidth;
|
||||||
private $fillHeight;
|
private $fillHeight;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow remote file download, default is to disallow remote file download.
|
* Allow remote file download, default is to disallow remote file download.
|
||||||
*/
|
*/
|
||||||
private $allowRemote = false;
|
private $allowRemote = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to cache for remote download.
|
||||||
|
*/
|
||||||
|
private $remoteCache;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pattern to recognize a remote file.
|
* Pattern to recognize a remote file.
|
||||||
*/
|
*/
|
||||||
@@ -1324,7 +1331,7 @@ class CImage
|
|||||||
*/
|
*/
|
||||||
const RESIZE = 1;
|
const RESIZE = 1;
|
||||||
const RESAMPLE = 2;
|
const RESAMPLE = 2;
|
||||||
private $copyStrategy = null;
|
private $copyStrategy = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1555,7 +1562,7 @@ class CImage
|
|||||||
|
|
||||||
if ($extension == 'jpeg') {
|
if ($extension == 'jpeg') {
|
||||||
$extension = 'jpg';
|
$extension = 'jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $extension;
|
return $extension;
|
||||||
}
|
}
|
||||||
@@ -2543,11 +2550,11 @@ class CImage
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCopyResizeStrategy($strategy)
|
public function setCopyResizeStrategy($strategy)
|
||||||
{
|
{
|
||||||
$this->copyStrategy = $strategy;
|
$this->copyStrategy = $strategy;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2558,7 +2565,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)
|
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");
|
$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);
|
imagecopyresized($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
|
||||||
} else {
|
} else {
|
||||||
@@ -3236,7 +3243,7 @@ class CImage
|
|||||||
|
|
||||||
$type = $this->getTargetImageExtension();
|
$type = $this->getTargetImageExtension();
|
||||||
$this->Log("Saving image as " . $type);
|
$this->Log("Saving image as " . $type);
|
||||||
switch ($type) {
|
switch($type) {
|
||||||
|
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
@@ -3473,7 +3480,7 @@ class CImage
|
|||||||
header('Last-Modified: ' . $gmdate . " GMT");
|
header('Last-Modified: ' . $gmdate . " GMT");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->HTTPHeader as $key => $val) {
|
foreach($this->HTTPHeader as $key => $val) {
|
||||||
header("$key: $val");
|
header("$key: $val");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user