mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-27 17:39:51 +02:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bb60001c36 | ||
|
adeca3f9f9 | ||
|
a5662690fe | ||
|
3cfa9a6a98 | ||
|
4ecebcd5b4 | ||
|
9196d1ee41 | ||
|
0249056761 | ||
|
4ea72be49a | ||
|
2ce1f18fe5 | ||
|
0f1f537b62 | ||
|
1411adc828 | ||
|
86737af69e |
23
CImage.php
23
CImage.php
@@ -423,6 +423,13 @@ class CImage
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use interlaced progressive mode for JPEG images.
|
||||||
|
*/
|
||||||
|
private $interlace = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Image copy strategy, defaults to RESAMPLE.
|
* Image copy strategy, defaults to RESAMPLE.
|
||||||
*/
|
*/
|
||||||
@@ -838,6 +845,7 @@ class CImage
|
|||||||
'blur' => null,
|
'blur' => null,
|
||||||
'convolve' => null,
|
'convolve' => null,
|
||||||
'rotateAfter' => null,
|
'rotateAfter' => null,
|
||||||
|
'interlace' => null,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => null,
|
'outputFormat' => null,
|
||||||
@@ -1183,7 +1191,7 @@ class CImage
|
|||||||
$this->newWidth = $width;
|
$this->newWidth = $width;
|
||||||
$this->newHeight = $height;
|
$this->newHeight = $height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get image dimensions for pre-resize image.
|
// Get image dimensions for pre-resize image.
|
||||||
if ($this->cropToFit || $this->fillToFit) {
|
if ($this->cropToFit || $this->fillToFit) {
|
||||||
@@ -1402,6 +1410,7 @@ class CImage
|
|||||||
$rotateBefore = $this->rotateBefore ? "_rb{$this->rotateBefore}" : null;
|
$rotateBefore = $this->rotateBefore ? "_rb{$this->rotateBefore}" : null;
|
||||||
$rotateAfter = $this->rotateAfter ? "_ra{$this->rotateAfter}" : null;
|
$rotateAfter = $this->rotateAfter ? "_ra{$this->rotateAfter}" : null;
|
||||||
$lossy = $this->lossy ? "_l" : null;
|
$lossy = $this->lossy ? "_l" : null;
|
||||||
|
$interlace = $this->interlace ? "_i" : null;
|
||||||
|
|
||||||
$saveAs = $this->normalizeFileExtension();
|
$saveAs = $this->normalizeFileExtension();
|
||||||
$saveAs = $saveAs ? "_$saveAs" : null;
|
$saveAs = $saveAs ? "_$saveAs" : null;
|
||||||
@@ -1468,7 +1477,7 @@ class CImage
|
|||||||
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
||||||
. $optimize . $compress
|
. $optimize . $compress
|
||||||
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
||||||
. $convolve . $copyStrat . $lossy . $saveAs;
|
. $convolve . $copyStrat . $lossy . $interlace . $saveAs;
|
||||||
|
|
||||||
return $this->setTarget($file, $base);
|
return $this->setTarget($file, $base);
|
||||||
}
|
}
|
||||||
@@ -1788,7 +1797,7 @@ class CImage
|
|||||||
// Resize by crop to fit
|
// Resize by crop to fit
|
||||||
$this->log("Resizing using strategy - Crop to fit");
|
$this->log("Resizing using strategy - Crop to fit");
|
||||||
|
|
||||||
if (!$this->upscale
|
if (!$this->upscale
|
||||||
&& ($this->width < $this->newWidth || $this->height < $this->newHeight)) {
|
&& ($this->width < $this->newWidth || $this->height < $this->newHeight)) {
|
||||||
$this->log("Resizing - smaller image, do not upscale.");
|
$this->log("Resizing - smaller image, do not upscale.");
|
||||||
|
|
||||||
@@ -2367,7 +2376,7 @@ class CImage
|
|||||||
$this->jpegOptimizeCmd = null;
|
$this->jpegOptimizeCmd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists("png_lossy", $options)
|
if (array_key_exists("png_lossy", $options)
|
||||||
&& $options['png_lossy'] !== false) {
|
&& $options['png_lossy'] !== false) {
|
||||||
$this->pngLossy = $options['png_lossy'];
|
$this->pngLossy = $options['png_lossy'];
|
||||||
$this->pngLossyCmd = $options['png_lossy_cmd'];
|
$this->pngLossyCmd = $options['png_lossy_cmd'];
|
||||||
@@ -2440,6 +2449,12 @@ class CImage
|
|||||||
|
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
|
// Set as interlaced progressive JPEG
|
||||||
|
if ($this->interlace) {
|
||||||
|
$this->Log("Set JPEG image to be interlaced.");
|
||||||
|
$res = imageinterlace($this->image, true);
|
||||||
|
}
|
||||||
|
|
||||||
$this->Log("Saving image as JPEG to cache using quality = {$this->quality}.");
|
$this->Log("Saving image as JPEG to cache using quality = {$this->quality}.");
|
||||||
imagejpeg($this->image, $this->cacheFileName, $this->quality);
|
imagejpeg($this->image, $this->cacheFileName, $this->quality);
|
||||||
|
|
||||||
|
51
REVISION.md
51
REVISION.md
@@ -5,6 +5,43 @@ Revision history
|
|||||||
[](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
|
[](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master)
|
||||||
|
|
||||||
|
|
||||||
|
v0.8.2 (2021-10-27)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Remove bad configuration.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
v0.8.1 (2020-06-08)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Updated version number in define.php.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
v0.8.0 (2020-06-08)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Enable to set JPEG image as interlaced, implement feature #177.
|
||||||
|
* Add function getValue() to read from querystring.
|
||||||
|
* Set PHP 7.0 as precondition (to prepare to update the codebase).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
v0.7.23 (2020-05-06)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Fix error in composer.json
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
v0.7.22 (2020-05-06)
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
* Update composer.json and move ext-gd from required to suggested to ease installation where cli does not have all extensions installed.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
v0.7.21 (2020-01-15)
|
v0.7.21 (2020-01-15)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
@@ -14,7 +51,7 @@ v0.7.21 (2020-01-15)
|
|||||||
v0.7.20 (2017-11-06)
|
v0.7.20 (2017-11-06)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
* Remove webroot/img/{round8.PNG,wider.JPEG,wider.JPG} to avoid unzip warning message when installing with composer.
|
* Remove webroot/img/{round8.PNG,wider.JPEG,wider.JPG} to avoid unzip warning message when installing with composer.
|
||||||
* Adding docker-compose.yml #169.
|
* Adding docker-compose.yml #169.
|
||||||
|
|
||||||
|
|
||||||
@@ -107,7 +144,7 @@ v0.7.8 (2015-12-06)
|
|||||||
|
|
||||||
* HTTP error messages now 403, 404 and 500 as in #128 and #127.
|
* HTTP error messages now 403, 404 and 500 as in #128 and #127.
|
||||||
* More examples on dealing with cache through bash `bin/cache.bash`, #129.
|
* More examples on dealing with cache through bash `bin/cache.bash`, #129.
|
||||||
* Added conversion to sRGB using option `?srgb`. #120.
|
* Added conversion to sRGB using option `?srgb`. #120.
|
||||||
* Added Gitter badge to README, #126.
|
* Added Gitter badge to README, #126.
|
||||||
* Fix proper download url in README, #125.
|
* Fix proper download url in README, #125.
|
||||||
* Change path in `webroot/htaccess` to make it work in current environment.
|
* Change path in `webroot/htaccess` to make it work in current environment.
|
||||||
@@ -118,11 +155,11 @@ v0.7.7 (2015-10-21)
|
|||||||
|
|
||||||
* One can now add a HTTP header for Cache-Control in the config file, #109.
|
* One can now add a HTTP header for Cache-Control in the config file, #109.
|
||||||
* Added hook in img,php before CImage is called, #123.
|
* Added hook in img,php before CImage is called, #123.
|
||||||
* Added configuration for default jpeg quality and png compression in the config file, #107.
|
* Added configuration for default jpeg quality and png compression in the config file, #107.
|
||||||
* Strip comments and whitespace in imgs.php, #115.
|
* Strip comments and whitespace in imgs.php, #115.
|
||||||
* Bundle imgs.php did not have the correct mode.
|
* Bundle imgs.php did not have the correct mode.
|
||||||
* Adding option &status to get an overview of the installed on configured utilities, #116.
|
* Adding option &status to get an overview of the installed on configured utilities, #116.
|
||||||
* Bug, all files saved as png-files, when not saving as specific file.
|
* Bug, all files saved as png-files, when not saving as specific file.
|
||||||
* Removed saving filename extension for alias images.
|
* Removed saving filename extension for alias images.
|
||||||
* Added option to decide if resample or resize when copying images internally. `&no-resample` makes resize, instead of resample as is default.
|
* Added option to decide if resample or resize when copying images internally. `&no-resample` makes resize, instead of resample as is default.
|
||||||
* Verbose now correctly states if transparent color is detected.
|
* Verbose now correctly states if transparent color is detected.
|
||||||
@@ -177,14 +214,14 @@ v0.7.1 (2015-07-25)
|
|||||||
* Using `CWhitelist` for checking hotlinking to images, fix #88.
|
* Using `CWhitelist` for checking hotlinking to images, fix #88.
|
||||||
* Added mode for `test` which enables logging verbose mode to file, fix #97.
|
* Added mode for `test` which enables logging verbose mode to file, fix #97.
|
||||||
* Improved codestyle and added `phpcs.xml` to start using phpcs to check code style, fix #95.
|
* Improved codestyle and added `phpcs.xml` to start using phpcs to check code style, fix #95.
|
||||||
* Adding `composer.json` for publishing on packagist.
|
* Adding `composer.json` for publishing on packagist.
|
||||||
* Add permalink to setup for comparing images with `webroot/compare/compare.php`, fix #92.
|
* Add permalink to setup for comparing images with `webroot/compare/compare.php`, fix #92.
|
||||||
* Allow space in filename by using `urlencode()` and allow space as valid filenam character. fix #91.
|
* Allow space in filename by using `urlencode()` and allow space as valid filenam character. fix #91.
|
||||||
* Support redirections for remote images, fix #87, fix #90.
|
* Support redirections for remote images, fix #87, fix #90.
|
||||||
* Improving usage of Travis and Scrutinizer.
|
* Improving usage of Travis and Scrutinizer.
|
||||||
* Naming cache-file using md5 for remote images, fix #86.
|
* Naming cache-file using md5 for remote images, fix #86.
|
||||||
* Loading images without depending on filename extension, fix #85.
|
* Loading images without depending on filename extension, fix #85.
|
||||||
* Adding unittest with phpunit #84, fix #13
|
* Adding unittest with phpunit #84, fix #13
|
||||||
* Adding support for whitelist of remote hostnames, #84
|
* Adding support for whitelist of remote hostnames, #84
|
||||||
* Adding phpdoc, fix #48.
|
* Adding phpdoc, fix #48.
|
||||||
* Adding travis, fix #15.
|
* Adding travis, fix #15.
|
||||||
|
6
SECURITY.md
Normal file
6
SECURITY.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Security policy
|
||||||
|
======================
|
||||||
|
|
||||||
|
To report security vulnerabilities in the project, send en email to mikael.t.h.roos@gmail.com.
|
||||||
|
|
||||||
|
For other security related issues, please open an issue on the project.
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "mos/cimage",
|
"name": "mos/cimage",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Process, scale, resize, crop and filter images.",
|
"description": "Process, scale, resize, crop and filter images.",
|
||||||
"keywords": ["image", "imageprocessing", "gd"],
|
"keywords": ["image", "imageprocessing", "gd"],
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
"docs": "http://dbwebb.se/opensource/cimage"
|
"docs": "http://dbwebb.se/opensource/cimage"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3",
|
"php": ">=7.0"
|
||||||
"ext-gd": "*"
|
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-exif": "*",
|
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
|
"ext-exif": "*",
|
||||||
|
"ext-gd": "*",
|
||||||
"ext-imagick": "*"
|
"ext-imagick": "*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
// Version of cimage and img.php
|
// Version of cimage and img.php
|
||||||
define("CIMAGE_VERSION", "v0.7.20 (2017-11-06)");
|
define("CIMAGE_VERSION", "v0.8.2 (2021-10-27)");
|
||||||
|
|
||||||
// For CRemoteImage
|
// For CRemoteImage
|
||||||
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
||||||
|
79
docker-compose.yaml
Normal file
79
docker-compose.yaml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
cli:
|
||||||
|
image: anax/dev
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
apache:
|
||||||
|
image: anax/dev:apache
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
ports: [ "11000:80" ]
|
||||||
|
|
||||||
|
remserver:
|
||||||
|
image: anax/dev:apache
|
||||||
|
ports:
|
||||||
|
- "8090:80"
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php80:
|
||||||
|
image: anax/dev:php80
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php80-apache:
|
||||||
|
image: anax/dev:php80-apache
|
||||||
|
ports: [ "11080:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php74:
|
||||||
|
image: anax/dev:php74
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php74-apache:
|
||||||
|
image: anax/dev:php74-apache
|
||||||
|
ports: [ "11074:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php73:
|
||||||
|
image: anax/dev:php73
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php73-apache:
|
||||||
|
image: anax/dev:php73-apache
|
||||||
|
ports: [ "11073:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php72:
|
||||||
|
image: anax/dev:php72
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php72-apache:
|
||||||
|
image: anax/dev:php72-apache
|
||||||
|
ports: [ "11072:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php71:
|
||||||
|
image: anax/dev:php71
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php71-apache:
|
||||||
|
image: anax/dev:php71-apache
|
||||||
|
ports: [ "11071:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php70:
|
||||||
|
image: anax/dev:php70
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php70:
|
||||||
|
image: anax/dev:php70-apache
|
||||||
|
ports: [ "11070:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php56:
|
||||||
|
image: anax/dev:php56
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
||||||
|
|
||||||
|
php56:
|
||||||
|
image: anax/dev:php56-apache
|
||||||
|
ports: [ "11056:80" ]
|
||||||
|
volumes: [ ".:/home/anax/repo" ]
|
@@ -1,30 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
|
||||||
php74:
|
|
||||||
image: anax/dev:php74-apache
|
|
||||||
ports:
|
|
||||||
- "8074:80"
|
|
||||||
volumes:
|
|
||||||
- .:/home/anax/repo
|
|
||||||
|
|
||||||
php71:
|
|
||||||
image: cimage/php71-apache:latest
|
|
||||||
#build: .
|
|
||||||
ports:
|
|
||||||
- "8071:80"
|
|
||||||
volumes:
|
|
||||||
- ./:/var/www/html/
|
|
||||||
php70:
|
|
||||||
image: cimage/php70-apache:latest
|
|
||||||
#build: .
|
|
||||||
ports:
|
|
||||||
- "8070:80"
|
|
||||||
volumes:
|
|
||||||
- .:/var/www/html
|
|
||||||
php56:
|
|
||||||
image: cimage/php56-apache:latest
|
|
||||||
#build: .
|
|
||||||
ports:
|
|
||||||
- "8056:80"
|
|
||||||
volumes:
|
|
||||||
- .:/var/www/html
|
|
@@ -107,6 +107,25 @@ function getDefined($key, $defined, $undefined)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get value of input from query string or else $undefined.
|
||||||
|
*
|
||||||
|
* @param mixed $key as string or array of string values to look for in $_GET.
|
||||||
|
* @param mixed $undefined value to return when $key has no, or empty value in $_GET.
|
||||||
|
*
|
||||||
|
* @return mixed value as or $undefined.
|
||||||
|
*/
|
||||||
|
function getValue($key, $undefined)
|
||||||
|
{
|
||||||
|
$val = get($key);
|
||||||
|
if (is_null($val) || $val === "") {
|
||||||
|
return $undefined;
|
||||||
|
}
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get value from config array or default if key is not set in config array.
|
* Get value from config array or default if key is not set in config array.
|
||||||
*
|
*
|
||||||
@@ -132,7 +151,7 @@ function getConfig($key, $default)
|
|||||||
*
|
*
|
||||||
* @return void or array.
|
* @return void or array.
|
||||||
*/
|
*/
|
||||||
function verbose($msg = null)
|
function verbose($msg = null, $arg = "")
|
||||||
{
|
{
|
||||||
global $verbose, $verboseFile;
|
global $verbose, $verboseFile;
|
||||||
static $log = array();
|
static $log = array();
|
||||||
@@ -145,7 +164,15 @@ function verbose($msg = null)
|
|||||||
return $log;
|
return $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
$log[] = $msg;
|
if (is_null($arg)) {
|
||||||
|
$arg = "null";
|
||||||
|
} elseif ($arg === false) {
|
||||||
|
$arg = "false";
|
||||||
|
} elseif ($arg === true) {
|
||||||
|
$arg = "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
$log[] = $msg . $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3,6 +3,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
function e($str) {
|
||||||
|
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
body {
|
body {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,15 +134,15 @@ if (isset($_GET['input1'])) {
|
|||||||
// Use incoming from querystring as defaults
|
// Use incoming from querystring as defaults
|
||||||
?>
|
?>
|
||||||
CImage.compare({
|
CImage.compare({
|
||||||
"input1": "<?=$_GET['input1']?>",
|
"input1": "<?=e($_GET['input1'])?>",
|
||||||
"input2": "<?=$_GET['input2']?>",
|
"input2": "<?=e($_GET['input2'])?>",
|
||||||
"input3": "<?=$_GET['input3']?>",
|
"input3": "<?=e($_GET['input3'])?>",
|
||||||
"input4": "<?=$_GET['input4']?>",
|
"input4": "<?=e($_GET['input4'])?>",
|
||||||
"input5": "<?=$_GET['input5']?>",
|
"input5": "<?=e($_GET['input5'])?>",
|
||||||
"input6": "<?=$_GET['input6']?>",
|
"input6": "<?=e($_GET['input6'])?>",
|
||||||
"json": <?=$_GET['json']?>,
|
"json": <?=e($_GET['json'])?>,
|
||||||
"stack": <?=$_GET['stack']?>,
|
"stack": <?=e($_GET['stack'])?>,
|
||||||
"bg": <?=$_GET['bg']?>
|
"bg": <?=e($_GET['bg'])?>
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
} elseif (isset($script)) {
|
} elseif (isset($script)) {
|
||||||
|
@@ -285,7 +285,7 @@ $allowRemote = getConfig('remote_allow', false);
|
|||||||
|
|
||||||
if ($allowRemote && $passwordMatch !== false) {
|
if ($allowRemote && $passwordMatch !== false) {
|
||||||
$cacheRemote = $cache->getPathToSubdir("remote");
|
$cacheRemote = $cache->getPathToSubdir("remote");
|
||||||
|
|
||||||
$pattern = getConfig('remote_pattern', null);
|
$pattern = getConfig('remote_pattern', null);
|
||||||
$img->setRemoteDownload($allowRemote, $cacheRemote, $pattern);
|
$img->setRemoteDownload($allowRemote, $cacheRemote, $pattern);
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ if ($dummyEnabled && $srcImage === $dummyFilename) {
|
|||||||
matching file exists on the filesystem.',
|
matching file exists on the filesystem.',
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($imagePathConstraint && !$dummyImage && !$remoteSource) {
|
if ($imagePathConstraint && !$dummyImage && !$remoteSource) {
|
||||||
@@ -920,6 +920,18 @@ if ($cacheControl) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* interlace - Enable configuration for interlaced progressive JPEG images.
|
||||||
|
*/
|
||||||
|
$interlaceConfig = getConfig('interlace', null);
|
||||||
|
$interlaceValue = getValue('interlace', null);
|
||||||
|
$interlaceDefined = getDefined('interlace', true, null);
|
||||||
|
$interlace = $interlaceValue ?? $interlaceDefined ?? $interlaceConfig;
|
||||||
|
verbose("interlace (configfile) = ", $interlaceConfig);
|
||||||
|
verbose("interlace = ", $interlace);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare a dummy image and use it as source image.
|
* Prepare a dummy image and use it as source image.
|
||||||
*/
|
*/
|
||||||
@@ -1081,6 +1093,7 @@ if (is_callable($hookBeforeCImage)) {
|
|||||||
'blur' => $blur,
|
'blur' => $blur,
|
||||||
'convolve' => $convolve,
|
'convolve' => $convolve,
|
||||||
'rotateAfter' => $rotateAfter,
|
'rotateAfter' => $rotateAfter,
|
||||||
|
'interlace' => $interlace,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => $outputFormat,
|
'outputFormat' => $outputFormat,
|
||||||
@@ -1169,6 +1182,7 @@ $img->log("Incoming arguments: " . print_r(verbose(), 1))
|
|||||||
'blur' => $blur,
|
'blur' => $blur,
|
||||||
'convolve' => $convolve,
|
'convolve' => $convolve,
|
||||||
'rotateAfter' => $rotateAfter,
|
'rotateAfter' => $rotateAfter,
|
||||||
|
'interlace' => $interlace,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => $outputFormat,
|
'outputFormat' => $outputFormat,
|
||||||
|
@@ -116,7 +116,7 @@ return array(
|
|||||||
* password_type: 'text' // use plain password, not encoded,
|
* password_type: 'text' // use plain password, not encoded,
|
||||||
*/
|
*/
|
||||||
//'password_always' => false, // always require password,
|
//'password_always' => false, // always require password,
|
||||||
'password' => "moped", // "secret-password",
|
//'password' => "moped", // "secret-password",
|
||||||
//'password_type' => 'text', // supports 'text', 'md5', 'hash',
|
//'password_type' => 'text', // supports 'text', 'md5', 'hash',
|
||||||
|
|
||||||
|
|
||||||
@@ -485,6 +485,18 @@ return array(
|
|||||||
"scale" => 14,
|
"scale" => 14,
|
||||||
"luminanceStrategy" => 3,
|
"luminanceStrategy" => 3,
|
||||||
"customCharacterSet" => null,
|
"customCharacterSet" => null,
|
||||||
);
|
), */
|
||||||
},*/
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default options for creating interlaced progressive JPEG images. Set
|
||||||
|
* to true to always render jpeg images as interlaced. This setting can
|
||||||
|
* be overridden by using `?interlace`, `?interlace=true` or
|
||||||
|
* `?interlace=false`.
|
||||||
|
*
|
||||||
|
* Default values are:
|
||||||
|
* interlace: false
|
||||||
|
*/
|
||||||
|
/*'interlace' => false,*/
|
||||||
);
|
);
|
||||||
|
@@ -38,7 +38,7 @@ $config = array(
|
|||||||
|
|
||||||
|
|
||||||
// Version of cimage and img.php
|
// Version of cimage and img.php
|
||||||
define("CIMAGE_VERSION", "v0.7.20 (2017-11-06)");
|
define("CIMAGE_VERSION", "v0.8.2 (2021-10-27)");
|
||||||
|
|
||||||
// For CRemoteImage
|
// For CRemoteImage
|
||||||
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
||||||
@@ -158,6 +158,25 @@ function getDefined($key, $defined, $undefined)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get value of input from query string or else $undefined.
|
||||||
|
*
|
||||||
|
* @param mixed $key as string or array of string values to look for in $_GET.
|
||||||
|
* @param mixed $undefined value to return when $key has no, or empty value in $_GET.
|
||||||
|
*
|
||||||
|
* @return mixed value as or $undefined.
|
||||||
|
*/
|
||||||
|
function getValue($key, $undefined)
|
||||||
|
{
|
||||||
|
$val = get($key);
|
||||||
|
if (is_null($val) || $val === "") {
|
||||||
|
return $undefined;
|
||||||
|
}
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get value from config array or default if key is not set in config array.
|
* Get value from config array or default if key is not set in config array.
|
||||||
*
|
*
|
||||||
@@ -183,7 +202,7 @@ function getConfig($key, $default)
|
|||||||
*
|
*
|
||||||
* @return void or array.
|
* @return void or array.
|
||||||
*/
|
*/
|
||||||
function verbose($msg = null)
|
function verbose($msg = null, $arg = "")
|
||||||
{
|
{
|
||||||
global $verbose, $verboseFile;
|
global $verbose, $verboseFile;
|
||||||
static $log = array();
|
static $log = array();
|
||||||
@@ -196,7 +215,15 @@ function verbose($msg = null)
|
|||||||
return $log;
|
return $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
$log[] = $msg;
|
if (is_null($arg)) {
|
||||||
|
$arg = "null";
|
||||||
|
} elseif ($arg === false) {
|
||||||
|
$arg = "false";
|
||||||
|
} elseif ($arg === true) {
|
||||||
|
$arg = "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
$log[] = $msg . $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1533,6 +1560,13 @@ class CImage
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use interlaced progressive mode for JPEG images.
|
||||||
|
*/
|
||||||
|
private $interlace = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Image copy strategy, defaults to RESAMPLE.
|
* Image copy strategy, defaults to RESAMPLE.
|
||||||
*/
|
*/
|
||||||
@@ -1948,6 +1982,7 @@ class CImage
|
|||||||
'blur' => null,
|
'blur' => null,
|
||||||
'convolve' => null,
|
'convolve' => null,
|
||||||
'rotateAfter' => null,
|
'rotateAfter' => null,
|
||||||
|
'interlace' => null,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => null,
|
'outputFormat' => null,
|
||||||
@@ -2293,7 +2328,7 @@ class CImage
|
|||||||
$this->newWidth = $width;
|
$this->newWidth = $width;
|
||||||
$this->newHeight = $height;
|
$this->newHeight = $height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get image dimensions for pre-resize image.
|
// Get image dimensions for pre-resize image.
|
||||||
if ($this->cropToFit || $this->fillToFit) {
|
if ($this->cropToFit || $this->fillToFit) {
|
||||||
@@ -2512,6 +2547,7 @@ class CImage
|
|||||||
$rotateBefore = $this->rotateBefore ? "_rb{$this->rotateBefore}" : null;
|
$rotateBefore = $this->rotateBefore ? "_rb{$this->rotateBefore}" : null;
|
||||||
$rotateAfter = $this->rotateAfter ? "_ra{$this->rotateAfter}" : null;
|
$rotateAfter = $this->rotateAfter ? "_ra{$this->rotateAfter}" : null;
|
||||||
$lossy = $this->lossy ? "_l" : null;
|
$lossy = $this->lossy ? "_l" : null;
|
||||||
|
$interlace = $this->interlace ? "_i" : null;
|
||||||
|
|
||||||
$saveAs = $this->normalizeFileExtension();
|
$saveAs = $this->normalizeFileExtension();
|
||||||
$saveAs = $saveAs ? "_$saveAs" : null;
|
$saveAs = $saveAs ? "_$saveAs" : null;
|
||||||
@@ -2578,7 +2614,7 @@ class CImage
|
|||||||
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
||||||
. $optimize . $compress
|
. $optimize . $compress
|
||||||
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
||||||
. $convolve . $copyStrat . $lossy . $saveAs;
|
. $convolve . $copyStrat . $lossy . $interlace . $saveAs;
|
||||||
|
|
||||||
return $this->setTarget($file, $base);
|
return $this->setTarget($file, $base);
|
||||||
}
|
}
|
||||||
@@ -2898,7 +2934,7 @@ class CImage
|
|||||||
// Resize by crop to fit
|
// Resize by crop to fit
|
||||||
$this->log("Resizing using strategy - Crop to fit");
|
$this->log("Resizing using strategy - Crop to fit");
|
||||||
|
|
||||||
if (!$this->upscale
|
if (!$this->upscale
|
||||||
&& ($this->width < $this->newWidth || $this->height < $this->newHeight)) {
|
&& ($this->width < $this->newWidth || $this->height < $this->newHeight)) {
|
||||||
$this->log("Resizing - smaller image, do not upscale.");
|
$this->log("Resizing - smaller image, do not upscale.");
|
||||||
|
|
||||||
@@ -3477,7 +3513,7 @@ class CImage
|
|||||||
$this->jpegOptimizeCmd = null;
|
$this->jpegOptimizeCmd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists("png_lossy", $options)
|
if (array_key_exists("png_lossy", $options)
|
||||||
&& $options['png_lossy'] !== false) {
|
&& $options['png_lossy'] !== false) {
|
||||||
$this->pngLossy = $options['png_lossy'];
|
$this->pngLossy = $options['png_lossy'];
|
||||||
$this->pngLossyCmd = $options['png_lossy_cmd'];
|
$this->pngLossyCmd = $options['png_lossy_cmd'];
|
||||||
@@ -3550,6 +3586,12 @@ class CImage
|
|||||||
|
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
|
// Set as interlaced progressive JPEG
|
||||||
|
if ($this->interlace) {
|
||||||
|
$this->Log("Set JPEG image to be interlaced.");
|
||||||
|
$res = imageinterlace($this->image, true);
|
||||||
|
}
|
||||||
|
|
||||||
$this->Log("Saving image as JPEG to cache using quality = {$this->quality}.");
|
$this->Log("Saving image as JPEG to cache using quality = {$this->quality}.");
|
||||||
imagejpeg($this->image, $this->cacheFileName, $this->quality);
|
imagejpeg($this->image, $this->cacheFileName, $this->quality);
|
||||||
|
|
||||||
@@ -4681,7 +4723,7 @@ $allowRemote = getConfig('remote_allow', false);
|
|||||||
|
|
||||||
if ($allowRemote && $passwordMatch !== false) {
|
if ($allowRemote && $passwordMatch !== false) {
|
||||||
$cacheRemote = $cache->getPathToSubdir("remote");
|
$cacheRemote = $cache->getPathToSubdir("remote");
|
||||||
|
|
||||||
$pattern = getConfig('remote_pattern', null);
|
$pattern = getConfig('remote_pattern', null);
|
||||||
$img->setRemoteDownload($allowRemote, $cacheRemote, $pattern);
|
$img->setRemoteDownload($allowRemote, $cacheRemote, $pattern);
|
||||||
|
|
||||||
@@ -4777,7 +4819,7 @@ if ($dummyEnabled && $srcImage === $dummyFilename) {
|
|||||||
matching file exists on the filesystem.',
|
matching file exists on the filesystem.',
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($imagePathConstraint && !$dummyImage && !$remoteSource) {
|
if ($imagePathConstraint && !$dummyImage && !$remoteSource) {
|
||||||
@@ -5316,6 +5358,18 @@ if ($cacheControl) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* interlace - Enable configuration for interlaced progressive JPEG images.
|
||||||
|
*/
|
||||||
|
$interlaceConfig = getConfig('interlace', null);
|
||||||
|
$interlaceValue = getValue('interlace', null);
|
||||||
|
$interlaceDefined = getDefined('interlace', true, null);
|
||||||
|
$interlace = $interlaceValue ?? $interlaceDefined ?? $interlaceConfig;
|
||||||
|
verbose("interlace (configfile) = ", $interlaceConfig);
|
||||||
|
verbose("interlace = ", $interlace);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare a dummy image and use it as source image.
|
* Prepare a dummy image and use it as source image.
|
||||||
*/
|
*/
|
||||||
@@ -5477,6 +5531,7 @@ if (is_callable($hookBeforeCImage)) {
|
|||||||
'blur' => $blur,
|
'blur' => $blur,
|
||||||
'convolve' => $convolve,
|
'convolve' => $convolve,
|
||||||
'rotateAfter' => $rotateAfter,
|
'rotateAfter' => $rotateAfter,
|
||||||
|
'interlace' => $interlace,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => $outputFormat,
|
'outputFormat' => $outputFormat,
|
||||||
@@ -5565,6 +5620,7 @@ $img->log("Incoming arguments: " . print_r(verbose(), 1))
|
|||||||
'blur' => $blur,
|
'blur' => $blur,
|
||||||
'convolve' => $convolve,
|
'convolve' => $convolve,
|
||||||
'rotateAfter' => $rotateAfter,
|
'rotateAfter' => $rotateAfter,
|
||||||
|
'interlace' => $interlace,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => $outputFormat,
|
'outputFormat' => $outputFormat,
|
||||||
|
@@ -38,7 +38,7 @@ $config = array(
|
|||||||
|
|
||||||
|
|
||||||
// Version of cimage and img.php
|
// Version of cimage and img.php
|
||||||
define("CIMAGE_VERSION", "v0.7.20 (2017-11-06)");
|
define("CIMAGE_VERSION", "v0.8.2 (2021-10-27)");
|
||||||
|
|
||||||
// For CRemoteImage
|
// For CRemoteImage
|
||||||
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
define("CIMAGE_USER_AGENT", "CImage/" . CIMAGE_VERSION);
|
||||||
@@ -158,6 +158,25 @@ function getDefined($key, $defined, $undefined)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get value of input from query string or else $undefined.
|
||||||
|
*
|
||||||
|
* @param mixed $key as string or array of string values to look for in $_GET.
|
||||||
|
* @param mixed $undefined value to return when $key has no, or empty value in $_GET.
|
||||||
|
*
|
||||||
|
* @return mixed value as or $undefined.
|
||||||
|
*/
|
||||||
|
function getValue($key, $undefined)
|
||||||
|
{
|
||||||
|
$val = get($key);
|
||||||
|
if (is_null($val) || $val === "") {
|
||||||
|
return $undefined;
|
||||||
|
}
|
||||||
|
return $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get value from config array or default if key is not set in config array.
|
* Get value from config array or default if key is not set in config array.
|
||||||
*
|
*
|
||||||
@@ -183,7 +202,7 @@ function getConfig($key, $default)
|
|||||||
*
|
*
|
||||||
* @return void or array.
|
* @return void or array.
|
||||||
*/
|
*/
|
||||||
function verbose($msg = null)
|
function verbose($msg = null, $arg = "")
|
||||||
{
|
{
|
||||||
global $verbose, $verboseFile;
|
global $verbose, $verboseFile;
|
||||||
static $log = array();
|
static $log = array();
|
||||||
@@ -196,7 +215,15 @@ function verbose($msg = null)
|
|||||||
return $log;
|
return $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
$log[] = $msg;
|
if (is_null($arg)) {
|
||||||
|
$arg = "null";
|
||||||
|
} elseif ($arg === false) {
|
||||||
|
$arg = "false";
|
||||||
|
} elseif ($arg === true) {
|
||||||
|
$arg = "true";
|
||||||
|
}
|
||||||
|
|
||||||
|
$log[] = $msg . $arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1533,6 +1560,13 @@ class CImage
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Use interlaced progressive mode for JPEG images.
|
||||||
|
*/
|
||||||
|
private $interlace = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Image copy strategy, defaults to RESAMPLE.
|
* Image copy strategy, defaults to RESAMPLE.
|
||||||
*/
|
*/
|
||||||
@@ -1948,6 +1982,7 @@ class CImage
|
|||||||
'blur' => null,
|
'blur' => null,
|
||||||
'convolve' => null,
|
'convolve' => null,
|
||||||
'rotateAfter' => null,
|
'rotateAfter' => null,
|
||||||
|
'interlace' => null,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => null,
|
'outputFormat' => null,
|
||||||
@@ -2293,7 +2328,7 @@ class CImage
|
|||||||
$this->newWidth = $width;
|
$this->newWidth = $width;
|
||||||
$this->newHeight = $height;
|
$this->newHeight = $height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get image dimensions for pre-resize image.
|
// Get image dimensions for pre-resize image.
|
||||||
if ($this->cropToFit || $this->fillToFit) {
|
if ($this->cropToFit || $this->fillToFit) {
|
||||||
@@ -2512,6 +2547,7 @@ class CImage
|
|||||||
$rotateBefore = $this->rotateBefore ? "_rb{$this->rotateBefore}" : null;
|
$rotateBefore = $this->rotateBefore ? "_rb{$this->rotateBefore}" : null;
|
||||||
$rotateAfter = $this->rotateAfter ? "_ra{$this->rotateAfter}" : null;
|
$rotateAfter = $this->rotateAfter ? "_ra{$this->rotateAfter}" : null;
|
||||||
$lossy = $this->lossy ? "_l" : null;
|
$lossy = $this->lossy ? "_l" : null;
|
||||||
|
$interlace = $this->interlace ? "_i" : null;
|
||||||
|
|
||||||
$saveAs = $this->normalizeFileExtension();
|
$saveAs = $this->normalizeFileExtension();
|
||||||
$saveAs = $saveAs ? "_$saveAs" : null;
|
$saveAs = $saveAs ? "_$saveAs" : null;
|
||||||
@@ -2578,7 +2614,7 @@ class CImage
|
|||||||
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
. $quality . $filters . $sharpen . $emboss . $blur . $palette
|
||||||
. $optimize . $compress
|
. $optimize . $compress
|
||||||
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
. $scale . $rotateBefore . $rotateAfter . $autoRotate . $bgColor
|
||||||
. $convolve . $copyStrat . $lossy . $saveAs;
|
. $convolve . $copyStrat . $lossy . $interlace . $saveAs;
|
||||||
|
|
||||||
return $this->setTarget($file, $base);
|
return $this->setTarget($file, $base);
|
||||||
}
|
}
|
||||||
@@ -2898,7 +2934,7 @@ class CImage
|
|||||||
// Resize by crop to fit
|
// Resize by crop to fit
|
||||||
$this->log("Resizing using strategy - Crop to fit");
|
$this->log("Resizing using strategy - Crop to fit");
|
||||||
|
|
||||||
if (!$this->upscale
|
if (!$this->upscale
|
||||||
&& ($this->width < $this->newWidth || $this->height < $this->newHeight)) {
|
&& ($this->width < $this->newWidth || $this->height < $this->newHeight)) {
|
||||||
$this->log("Resizing - smaller image, do not upscale.");
|
$this->log("Resizing - smaller image, do not upscale.");
|
||||||
|
|
||||||
@@ -3477,7 +3513,7 @@ class CImage
|
|||||||
$this->jpegOptimizeCmd = null;
|
$this->jpegOptimizeCmd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists("png_lossy", $options)
|
if (array_key_exists("png_lossy", $options)
|
||||||
&& $options['png_lossy'] !== false) {
|
&& $options['png_lossy'] !== false) {
|
||||||
$this->pngLossy = $options['png_lossy'];
|
$this->pngLossy = $options['png_lossy'];
|
||||||
$this->pngLossyCmd = $options['png_lossy_cmd'];
|
$this->pngLossyCmd = $options['png_lossy_cmd'];
|
||||||
@@ -3550,6 +3586,12 @@ class CImage
|
|||||||
|
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
|
// Set as interlaced progressive JPEG
|
||||||
|
if ($this->interlace) {
|
||||||
|
$this->Log("Set JPEG image to be interlaced.");
|
||||||
|
$res = imageinterlace($this->image, true);
|
||||||
|
}
|
||||||
|
|
||||||
$this->Log("Saving image as JPEG to cache using quality = {$this->quality}.");
|
$this->Log("Saving image as JPEG to cache using quality = {$this->quality}.");
|
||||||
imagejpeg($this->image, $this->cacheFileName, $this->quality);
|
imagejpeg($this->image, $this->cacheFileName, $this->quality);
|
||||||
|
|
||||||
@@ -4681,7 +4723,7 @@ $allowRemote = getConfig('remote_allow', false);
|
|||||||
|
|
||||||
if ($allowRemote && $passwordMatch !== false) {
|
if ($allowRemote && $passwordMatch !== false) {
|
||||||
$cacheRemote = $cache->getPathToSubdir("remote");
|
$cacheRemote = $cache->getPathToSubdir("remote");
|
||||||
|
|
||||||
$pattern = getConfig('remote_pattern', null);
|
$pattern = getConfig('remote_pattern', null);
|
||||||
$img->setRemoteDownload($allowRemote, $cacheRemote, $pattern);
|
$img->setRemoteDownload($allowRemote, $cacheRemote, $pattern);
|
||||||
|
|
||||||
@@ -4777,7 +4819,7 @@ if ($dummyEnabled && $srcImage === $dummyFilename) {
|
|||||||
matching file exists on the filesystem.',
|
matching file exists on the filesystem.',
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($imagePathConstraint && !$dummyImage && !$remoteSource) {
|
if ($imagePathConstraint && !$dummyImage && !$remoteSource) {
|
||||||
@@ -5316,6 +5358,18 @@ if ($cacheControl) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* interlace - Enable configuration for interlaced progressive JPEG images.
|
||||||
|
*/
|
||||||
|
$interlaceConfig = getConfig('interlace', null);
|
||||||
|
$interlaceValue = getValue('interlace', null);
|
||||||
|
$interlaceDefined = getDefined('interlace', true, null);
|
||||||
|
$interlace = $interlaceValue ?? $interlaceDefined ?? $interlaceConfig;
|
||||||
|
verbose("interlace (configfile) = ", $interlaceConfig);
|
||||||
|
verbose("interlace = ", $interlace);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare a dummy image and use it as source image.
|
* Prepare a dummy image and use it as source image.
|
||||||
*/
|
*/
|
||||||
@@ -5477,6 +5531,7 @@ if (is_callable($hookBeforeCImage)) {
|
|||||||
'blur' => $blur,
|
'blur' => $blur,
|
||||||
'convolve' => $convolve,
|
'convolve' => $convolve,
|
||||||
'rotateAfter' => $rotateAfter,
|
'rotateAfter' => $rotateAfter,
|
||||||
|
'interlace' => $interlace,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => $outputFormat,
|
'outputFormat' => $outputFormat,
|
||||||
@@ -5565,6 +5620,7 @@ $img->log("Incoming arguments: " . print_r(verbose(), 1))
|
|||||||
'blur' => $blur,
|
'blur' => $blur,
|
||||||
'convolve' => $convolve,
|
'convolve' => $convolve,
|
||||||
'rotateAfter' => $rotateAfter,
|
'rotateAfter' => $rotateAfter,
|
||||||
|
'interlace' => $interlace,
|
||||||
|
|
||||||
// Output format
|
// Output format
|
||||||
'outputFormat' => $outputFormat,
|
'outputFormat' => $outputFormat,
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user