1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-04-21 17:31:58 +02:00

Prepare tagging v0.3

This commit is contained in:
Mikael Roos 2012-10-02 23:25:03 +02:00
parent e4c436f52c
commit 9e3c7fae82
4 changed files with 13 additions and 5 deletions

View File

@ -88,6 +88,7 @@ class CImage {
}
}
$subdir = str_replace('/', '-', dirname($this->imageName));
$subdir = '.' ? '_.' : $subdir;
return $this->saveFolder . '/' . $subdir . '_' . $parts['filename'] . '_' . round($this->newWidth) . '_' . round($this->newHeight) . $crop . $cropToFit . $crop_x . $crop_y . $quality . $filters . '.' . $parts['extension'];
}

View File

@ -19,6 +19,8 @@ Start by reviewing the `test.php`, then have a look at `img.php` and finally go
CImage lives at github: https://github.com/mosbth/cimage
You can try out a live example at: http://dbwebb.se/kod-exempel/cimage/
Enjoy!
Mikael Roos (me@mikaelroos.se)
@ -27,7 +29,7 @@ Mikael Roos (me@mikaelroos.se)
Installation
-------------------------------------
1. Clone from github: git://github.com/mosbth/cimage.git
1. Clone from github: `git://github.com/mosbth/cimage.git`
2. Make the cache directory writable by the webserver.
@ -37,7 +39,9 @@ chmod 777 cache
3. Point your browser to `test.php`.
4. Advanced usage. Put `img.php` in your `/img`-directory. Create a `.htaccess` in your
4. Review the settings in `img.php` and try it out.
5. Advanced usage. Put `img.php` in your `/img`-directory. Create a `.htaccess` in your
web root folder containing the following line:
<pre><code>
@ -58,6 +62,7 @@ ToDo.
center of the image from which the crop is done.
* Show how to integrate with WordPress, shortcodes.
* Support for resizing opaque images.
* Clean up code in `CImage.php`.
v0.3 (2012-10-02)

View File

@ -11,9 +11,9 @@ error_reporting(-1);
set_time_limit(20);
// Append ending slash
$cimageClassFile = __DIR__ .'/CImage.php';
$pathToImages = __DIR__.'/img/';
$pathToCache = __DIR__.'/cache/';
$cimageClassFile = __DIR__ .'/CImage.php';
$pathToImages = __DIR__.'/img/';
$pathToCache = __DIR__.'/cache/';
$maxWidth = $maxHeight = 2000;
// Set areas to map constant to value, easier to use with width or height

View File

@ -31,6 +31,7 @@
$testcase = array(
array('text'=>'Original image', 'query'=>''),
array('text'=>'Crop out a rectangle of 100x100, start by position 200x200.', 'query'=>'&crop=100,100,200,200'),
array('text'=>'Crop out a full width rectangle with height of 200, start by position 0x100.', 'query'=>'&crop=0,200,0,100'),
array('text'=>'Max width 200.', 'query'=>'&w=200'),
array('text'=>'Max height 200.', 'query'=>'&h=200'),
array('text'=>'Max width 200 and max height 200.', 'query'=>'&w=200&h=200'),
@ -54,6 +55,7 @@ $testcase = array(
array('text'=>'Filter: Smooth 2', 'query'=>'&w=200&h=200&f=smooth,2'),
array('text'=>'Filter: Pixelate 10,10', 'query'=>'&w=200&h=200&f=pixelate,10,10'),
array('text'=>'Multiple filter: Negate, Grayscale and Pixelate 10,10', 'query'=>'&w=200&h=200&&f=negate&f0=grayscale&f1=pixelate,10,10'),
array('text'=>'Crop with width & height and crop-to-fit with quality and filter', 'query'=>'&crop=100,100,100,100&w=200&h=200&crop-to-fit&q=70&f0=grayscale'),
);
?>