mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-05 07:37:37 +02:00
Prepare tagging v0.3
This commit is contained in:
@@ -88,6 +88,7 @@ class CImage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$subdir = str_replace('/', '-', dirname($this->imageName));
|
$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'];
|
return $this->saveFolder . '/' . $subdir . '_' . $parts['filename'] . '_' . round($this->newWidth) . '_' . round($this->newHeight) . $crop . $cropToFit . $crop_x . $crop_y . $quality . $filters . '.' . $parts['extension'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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
|
CImage lives at github: https://github.com/mosbth/cimage
|
||||||
|
|
||||||
|
You can try out a live example at: http://dbwebb.se/kod-exempel/cimage/
|
||||||
|
|
||||||
Enjoy!
|
Enjoy!
|
||||||
|
|
||||||
Mikael Roos (me@mikaelroos.se)
|
Mikael Roos (me@mikaelroos.se)
|
||||||
@@ -27,7 +29,7 @@ Mikael Roos (me@mikaelroos.se)
|
|||||||
Installation
|
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.
|
2. Make the cache directory writable by the webserver.
|
||||||
|
|
||||||
@@ -37,7 +39,9 @@ chmod 777 cache
|
|||||||
|
|
||||||
3. Point your browser to `test.php`.
|
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:
|
web root folder containing the following line:
|
||||||
|
|
||||||
<pre><code>
|
<pre><code>
|
||||||
@@ -58,6 +62,7 @@ ToDo.
|
|||||||
center of the image from which the crop is done.
|
center of the image from which the crop is done.
|
||||||
* Show how to integrate with WordPress, shortcodes.
|
* Show how to integrate with WordPress, shortcodes.
|
||||||
* Support for resizing opaque images.
|
* Support for resizing opaque images.
|
||||||
|
* Clean up code in `CImage.php`.
|
||||||
|
|
||||||
v0.3 (2012-10-02)
|
v0.3 (2012-10-02)
|
||||||
|
|
||||||
|
2
test.php
2
test.php
@@ -31,6 +31,7 @@
|
|||||||
$testcase = array(
|
$testcase = array(
|
||||||
array('text'=>'Original image', 'query'=>''),
|
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 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 width 200.', 'query'=>'&w=200'),
|
||||||
array('text'=>'Max height 200.', 'query'=>'&h=200'),
|
array('text'=>'Max height 200.', 'query'=>'&h=200'),
|
||||||
array('text'=>'Max width 200 and max height 200.', 'query'=>'&w=200&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: 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'=>'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'=>'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'),
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user