mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-30 10:59:51 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f9604518e4 | ||
|
61aa52854e | ||
|
401478c839 | ||
|
f0ab9479d6 | ||
|
9ff7a61ca9 | ||
|
3170beb832 | ||
|
8001f72a1a | ||
|
0f9e0220f1 |
@@ -1365,6 +1365,7 @@ class CImage
|
|||||||
&& !$this->autoRotate
|
&& !$this->autoRotate
|
||||||
&& !$this->bgColor
|
&& !$this->bgColor
|
||||||
&& ($this->upscale === self::UPSCALE_DEFAULT)
|
&& ($this->upscale === self::UPSCALE_DEFAULT)
|
||||||
|
&& !$this->lossy
|
||||||
) {
|
) {
|
||||||
$this->log("Using original image.");
|
$this->log("Using original image.");
|
||||||
$this->output($this->pathToImage);
|
$this->output($this->pathToImage);
|
||||||
|
@@ -49,14 +49,14 @@ There are several ways of installing. You either install the whole project which
|
|||||||
|
|
||||||
The [sourcode is available on GitHub](https://github.com/mosbth/cimage). Clone, fork or [download as zip](https://github.com/mosbth/cimage/archive/master.zip).
|
The [sourcode is available on GitHub](https://github.com/mosbth/cimage). Clone, fork or [download as zip](https://github.com/mosbth/cimage/archive/master.zip).
|
||||||
|
|
||||||
**Latest stable version is v0.7.17 released 2016-08-09.**
|
**Latest stable version is v0.7.18 released 2016-08-09.**
|
||||||
|
|
||||||
I prefer cloning like this. Do switch to the latest stable version.
|
I prefer cloning like this. Do switch to the latest stable version.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git://github.com/mosbth/cimage.git
|
git clone git://github.com/mosbth/cimage.git
|
||||||
cd cimage
|
cd cimage
|
||||||
git checkout v0.7.17
|
git checkout v0.7.18
|
||||||
```
|
```
|
||||||
|
|
||||||
Make the cache-directory writable by the webserver.
|
Make the cache-directory writable by the webserver.
|
||||||
@@ -79,7 +79,7 @@ There are some all-included bundles of `img.php` that can be downloaded and used
|
|||||||
Dowload the version of your choice like this.
|
Dowload the version of your choice like this.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget https://raw.githubusercontent.com/mosbth/cimage/v0.7.17/webroot/imgp.php
|
wget https://raw.githubusercontent.com/mosbth/cimage/v0.7.18/webroot/imgp.php
|
||||||
```
|
```
|
||||||
|
|
||||||
Open up the file in your editor and edit the array `$config`. Ensure that the paths to the image directory and the cache directory matches your environment, or create an own config-file for the script.
|
Open up the file in your editor and edit the array `$config`. Ensure that the paths to the image directory and the cache directory matches your environment, or create an own config-file for the script.
|
||||||
|
14
REVISION.md
14
REVISION.md
@@ -5,6 +5,20 @@ Revision history
|
|||||||
[](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
|
[](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
|
||||||
|
|
||||||
|
|
||||||
|
v0.7.19 (2017-03-31)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Move exception handler from functions.php to img.php.
|
||||||
|
* Correct XSS injection in `check_system.php`.
|
||||||
|
* Composer suggests ext-imagick and ext-curl.
|
||||||
|
|
||||||
|
|
||||||
|
v0.7.18 (2016-08-09)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Made `&lossless` a requirement to not use the original image.
|
||||||
|
|
||||||
|
|
||||||
v0.7.17 (2016-08-09)
|
v0.7.17 (2016-08-09)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
@@ -22,7 +22,9 @@
|
|||||||
"ext-gd": "*"
|
"ext-gd": "*"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-exif": "*"
|
"ext-exif": "*",
|
||||||
|
"ext-curl": "*",
|
||||||
|
"ext-imagick": "*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
// Version of cimage and img.php
|
// Version of cimage and img.php
|
||||||
define("CIMAGE_VERSION", "v0.7.17 (2016-08-09)");
|
define("CIMAGE_VERSION", "v0.7.19 (2017-03-31)");
|
||||||
|
|
||||||
// For CRemoteImage
|
// For CRemoteImage
|
||||||
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
||||||
|
@@ -67,22 +67,6 @@ function errorPage($msg, $type = 500)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom exception handler.
|
|
||||||
*/
|
|
||||||
set_exception_handler(function ($exception) {
|
|
||||||
errorPage(
|
|
||||||
"<p><b>img.php: Uncaught exception:</b> <p>"
|
|
||||||
. $exception->getMessage()
|
|
||||||
. "</p><pre>"
|
|
||||||
. $exception->getTraceAsString()
|
|
||||||
. "</pre>",
|
|
||||||
500
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get input from query string or return default value if not set.
|
* Get input from query string or return default value if not set.
|
||||||
*
|
*
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
echo 'Current PHP version: ' . phpversion() . '<br><br>';
|
echo 'Current PHP version: ' . phpversion() . '<br><br>';
|
||||||
|
|
||||||
echo 'Running on: ' . $_SERVER['SERVER_SOFTWARE'] . '<br><br>';
|
echo 'Running on: ' . htmlentities($_SERVER['SERVER_SOFTWARE']) . '<br><br>';
|
||||||
|
|
||||||
$no = extension_loaded('exif') ? null : 'NOT';
|
$no = extension_loaded('exif') ? null : 'NOT';
|
||||||
echo "Extension exif is $no loaded.<br>";
|
echo "Extension exif is $no loaded.<br>";
|
||||||
|
@@ -8,6 +8,22 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom exception handler.
|
||||||
|
*/
|
||||||
|
set_exception_handler(function ($exception) {
|
||||||
|
errorPage(
|
||||||
|
"<p><b>img.php: Uncaught exception:</b> <p>"
|
||||||
|
. $exception->getMessage()
|
||||||
|
. "</p><pre>"
|
||||||
|
. $exception->getTraceAsString()
|
||||||
|
. "</pre>",
|
||||||
|
500
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get configuration options from file, if the file exists, else use $config
|
* Get configuration options from file, if the file exists, else use $config
|
||||||
* if its defined or create an empty $config.
|
* if its defined or create an empty $config.
|
||||||
|
@@ -38,7 +38,7 @@ $config = array(
|
|||||||
|
|
||||||
|
|
||||||
// Version of cimage and img.php
|
// Version of cimage and img.php
|
||||||
define("CIMAGE_VERSION", "v0.7.17 (2016-08-09)");
|
define("CIMAGE_VERSION", "v0.7.19 (2017-03-31)");
|
||||||
|
|
||||||
// For CRemoteImage
|
// For CRemoteImage
|
||||||
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
||||||
@@ -118,22 +118,6 @@ function errorPage($msg, $type = 500)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom exception handler.
|
|
||||||
*/
|
|
||||||
set_exception_handler(function ($exception) {
|
|
||||||
errorPage(
|
|
||||||
"<p><b>img.php: Uncaught exception:</b> <p>"
|
|
||||||
. $exception->getMessage()
|
|
||||||
. "</p><pre>"
|
|
||||||
. $exception->getTraceAsString()
|
|
||||||
. "</pre>",
|
|
||||||
500
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get input from query string or return default value if not set.
|
* Get input from query string or return default value if not set.
|
||||||
*
|
*
|
||||||
@@ -2491,6 +2475,7 @@ class CImage
|
|||||||
&& !$this->autoRotate
|
&& !$this->autoRotate
|
||||||
&& !$this->bgColor
|
&& !$this->bgColor
|
||||||
&& ($this->upscale === self::UPSCALE_DEFAULT)
|
&& ($this->upscale === self::UPSCALE_DEFAULT)
|
||||||
|
&& !$this->lossy
|
||||||
) {
|
) {
|
||||||
$this->log("Using original image.");
|
$this->log("Using original image.");
|
||||||
$this->output($this->pathToImage);
|
$this->output($this->pathToImage);
|
||||||
@@ -4417,6 +4402,22 @@ class CFastTrackCache
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom exception handler.
|
||||||
|
*/
|
||||||
|
set_exception_handler(function ($exception) {
|
||||||
|
errorPage(
|
||||||
|
"<p><b>img.php: Uncaught exception:</b> <p>"
|
||||||
|
. $exception->getMessage()
|
||||||
|
. "</p><pre>"
|
||||||
|
. $exception->getTraceAsString()
|
||||||
|
. "</pre>",
|
||||||
|
500
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get configuration options from file, if the file exists, else use $config
|
* Get configuration options from file, if the file exists, else use $config
|
||||||
* if its defined or create an empty $config.
|
* if its defined or create an empty $config.
|
||||||
|
@@ -38,7 +38,7 @@ $config = array(
|
|||||||
|
|
||||||
|
|
||||||
// Version of cimage and img.php
|
// Version of cimage and img.php
|
||||||
define("CIMAGE_VERSION", "v0.7.17 (2016-08-09)");
|
define("CIMAGE_VERSION", "v0.7.19 (2017-03-31)");
|
||||||
|
|
||||||
// For CRemoteImage
|
// For CRemoteImage
|
||||||
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
||||||
@@ -118,22 +118,6 @@ function errorPage($msg, $type = 500)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom exception handler.
|
|
||||||
*/
|
|
||||||
set_exception_handler(function ($exception) {
|
|
||||||
errorPage(
|
|
||||||
"<p><b>img.php: Uncaught exception:</b> <p>"
|
|
||||||
. $exception->getMessage()
|
|
||||||
. "</p><pre>"
|
|
||||||
. $exception->getTraceAsString()
|
|
||||||
. "</pre>",
|
|
||||||
500
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get input from query string or return default value if not set.
|
* Get input from query string or return default value if not set.
|
||||||
*
|
*
|
||||||
@@ -2491,6 +2475,7 @@ class CImage
|
|||||||
&& !$this->autoRotate
|
&& !$this->autoRotate
|
||||||
&& !$this->bgColor
|
&& !$this->bgColor
|
||||||
&& ($this->upscale === self::UPSCALE_DEFAULT)
|
&& ($this->upscale === self::UPSCALE_DEFAULT)
|
||||||
|
&& !$this->lossy
|
||||||
) {
|
) {
|
||||||
$this->log("Using original image.");
|
$this->log("Using original image.");
|
||||||
$this->output($this->pathToImage);
|
$this->output($this->pathToImage);
|
||||||
@@ -4417,6 +4402,22 @@ class CFastTrackCache
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom exception handler.
|
||||||
|
*/
|
||||||
|
set_exception_handler(function ($exception) {
|
||||||
|
errorPage(
|
||||||
|
"<p><b>img.php: Uncaught exception:</b> <p>"
|
||||||
|
. $exception->getMessage()
|
||||||
|
. "</p><pre>"
|
||||||
|
. $exception->getTraceAsString()
|
||||||
|
. "</pre>",
|
||||||
|
500
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get configuration options from file, if the file exists, else use $config
|
* Get configuration options from file, if the file exists, else use $config
|
||||||
* if its defined or create an empty $config.
|
* if its defined or create an empty $config.
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user