mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-25 08:50:45 +02:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ec42c41e4d | ||
|
f12d02b8c1 | ||
|
1673cd7aca | ||
|
0fee846437 | ||
|
c63747a892 | ||
|
2d8cccc795 | ||
|
bb5fd6f115 |
@@ -1212,14 +1212,20 @@ class CImage
|
|||||||
{
|
{
|
||||||
if (isset($options['jpeg_optimize']) && $options['jpeg_optimize']) {
|
if (isset($options['jpeg_optimize']) && $options['jpeg_optimize']) {
|
||||||
$this->jpegOptimizeCmd = $options['jpeg_optimize_cmd'];
|
$this->jpegOptimizeCmd = $options['jpeg_optimize_cmd'];
|
||||||
|
} else {
|
||||||
|
$this->jpegOptimizeCmd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['png_filter']) && $options['png_filter']) {
|
if (isset($options['png_filter']) && $options['png_filter']) {
|
||||||
$this->pngFilterCmd = $options['png_filter_cmd'];
|
$this->pngFilterCmd = $options['png_filter_cmd'];
|
||||||
|
} else {
|
||||||
|
$this->pngFilterCmd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['png_deflate']) && $options['png_deflate']) {
|
if (isset($options['png_deflate']) && $options['png_deflate']) {
|
||||||
$this->pngDeflateCmd = $options['png_deflate_cmd'];
|
$this->pngDeflateCmd = $options['png_deflate_cmd'];
|
||||||
|
} else {
|
||||||
|
$this->pngDeflateCmd = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
24
README.md
24
README.md
@@ -26,12 +26,12 @@ This is free software and open source software, licensed according MIT.
|
|||||||
Installation and get going
|
Installation and get going
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
**Latest stable version is v0.5 released 2014-02-12.**
|
**Latest stable version is v0.5.2 released 2014-04-01.**
|
||||||
|
|
||||||
```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.5
|
git checkout v0.5.2
|
||||||
```
|
```
|
||||||
|
|
||||||
Make the cache-directory writable by the webserver.
|
Make the cache-directory writable by the webserver.
|
||||||
@@ -50,13 +50,13 @@ Review the settings in `webroot/img_config.php` and check out `webroot/img.php`
|
|||||||
Usage
|
Usage
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
###List of parameters {#parameters}
|
###List of parameters
|
||||||
|
|
||||||
The `img.php` supports a lot of parameters. Combine the parameters to get the desired behavior and resulting image. For example, take the original image, resize it using width, aspect-ratio and crop-to-fit, apply a sharpen effect, save the image as JPEG using quality 30.
|
The `img.php` supports a lot of parameters. Combine the parameters to get the desired behavior and resulting image. For example, take the original image, resize it using width, aspect-ratio and crop-to-fit, apply a sharpen effect, save the image as JPEG using quality 30.
|
||||||
|
|
||||||
| `img.php?src=kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30` |
|
| `img.php?src=kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30` |
|
||||||
|-----------------------------------------------------------|
|
|-----------------------------------------------------------|
|
||||||
| <img src=/kod-exempel/cimage_/webroot/img.php?src=kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30 alt=''> |
|
| <img src=http://dbwebb.se/kod-exempel/cimage_/webroot/img.php?src=kodim13.png&w=600&aspect-ratio=4&crop-to-fit&sharpen&save-as=jpg&q=30 alt=''> |
|
||||||
|
|
||||||
Here is a list of all parameters that you can use together with `img.php`, grouped by its basic intent of usage.
|
Here is a list of all parameters that you can use together with `img.php`, grouped by its basic intent of usage.
|
||||||
|
|
||||||
@@ -131,7 +131,21 @@ Revision history
|
|||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
|
||||||
v0.5 (2014-02-07)
|
v0.5.2 (2014-04-01)
|
||||||
|
|
||||||
|
* Correcting issue #26 providing error message when not using postprocessing.
|
||||||
|
* Correcting issue #27 warning of default timezone.
|
||||||
|
* Removed default $config options in `img.php`, was not used, all configuration should be in `img_config.php`.
|
||||||
|
* Verified known bug - sharpen acts as blur in PHP 5.5.9 and 5.5.10 #28
|
||||||
|
|
||||||
|
|
||||||
|
v0.5.1 (2014-02-12)
|
||||||
|
|
||||||
|
* Display image in README-file.
|
||||||
|
* Create an empty `cache` directory as part of repo.
|
||||||
|
|
||||||
|
|
||||||
|
v0.5 (2014-02-12)
|
||||||
|
|
||||||
* Change constant name `CImage::PNG_QUALITY_DEFAULT` to `CImage::PNG_COMPRESSION_DEFAULT`.
|
* Change constant name `CImage::PNG_QUALITY_DEFAULT` to `CImage::PNG_COMPRESSION_DEFAULT`.
|
||||||
* Split JPEG quality and PNG compression, `CImage->quality` and `CImage->compression`
|
* Split JPEG quality and PNG compression, `CImage->quality` and `CImage->compression`
|
||||||
|
1
cache/README.md
vendored
Normal file
1
cache/README.md
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
This directory must be writable by the webserver.
|
@@ -95,19 +95,26 @@ function verbose($msg = null)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default configuration options, can be overridden in own config-file.
|
* Get configuration options from file.
|
||||||
*/
|
*/
|
||||||
$config = array(
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
$configFile = __DIR__.'/'.basename(__FILE__, '.php').'_config.php';
|
$configFile = __DIR__.'/'.basename(__FILE__, '.php').'_config.php';
|
||||||
$config = array_merge($config, require $configFile);
|
$config = require $configFile;
|
||||||
|
|
||||||
call_user_func($config['error_reporting']);
|
call_user_func($config['error_reporting']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set default timezone if not set or if its set in the config-file.
|
||||||
|
*/
|
||||||
|
if (isset($config['default_timezone'])) {
|
||||||
|
date_default_timezone_set($config['default_timezone']);
|
||||||
|
} else if (!ini_get('default_timezone')) {
|
||||||
|
date_default_timezone_set('UTC');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* verbose, v - do a verbose dump of what happens
|
* verbose, v - do a verbose dump of what happens
|
||||||
*/
|
*/
|
||||||
|
@@ -17,6 +17,14 @@ return array(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set default timezone, it defaults to UTC if not specified otherwise.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//'default_timezone' => 'UTC',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Max image dimensions,
|
* Max image dimensions,
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user