1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-04 15:17:42 +02:00

correcting filenaming in cache dir

This commit is contained in:
Mikael Roos
2012-10-02 23:40:32 +02:00
parent 9e3c7fae82
commit 0998f2819e
2 changed files with 17 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ class CImage {
}
}
$subdir = str_replace('/', '-', dirname($this->imageName));
$subdir = '.' ? '_.' : $subdir;
$subdir = ($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

@@ -4,9 +4,9 @@ Image conversion on the fly using PHP
About
-------------------------------------
The `CImage.php` is a PHP class that can resize and crop images on the fly and output
them to, for example to a webpage. The class preserves a cache of the generated images
and responds with HTTP 304 (not modified) if the image has not changed.
The `CImage.php` is a PHP class that can resize and crop images on the fly on the server side
and output them to, for example to a webpage. The class preserves a cache of the generated
images and responds with HTTP 304 (not modified) if the image has not changed.
The file `img.php` uses `CImage.php` to resize images. It is a usecase on how to use
the class. `img.php` is useful for webpages which want to dynamically resize the images.
@@ -64,6 +64,17 @@ center of the image from which the crop is done.
* Support for resizing opaque images.
* Clean up code in `CImage.php`.
v0.4 (latest)
* Nothing yet.
v0.31 (2012-10-02)
* Corrected error on naming cache-files using subdir.
v0.3 (2012-10-02)
* Added crop. Can crop a area (`width`, `height`, `start_x`, `start_y`) from the original
@@ -71,6 +82,7 @@ image.
* Corrected to make the 304 Not Modified header work.
* Pre-defined sizes can be configured for width in `img.php`.
* Corrected to make crop work with width or height in combination with crop-to-fit.
v0.2 (2012-05-09)
@@ -80,6 +92,7 @@ v0.2 (2012-05-09)
* Added quality-setting.
* Added testcases for above.
v0.1.1 (2012-04-27)
* Corrected calculation where both width and height were set.