diff --git a/CImage.php b/CImage.php index 6c2c854..af97cad 100644 --- a/CImage.php +++ b/CImage.php @@ -1725,14 +1725,15 @@ class CImage $details['src'] = $this->imageSrc; $lastModified = filemtime($this->pathToImage); - $details['src-gmdate'] = gmdate("D, d M Y H:i:s", $lastModified); + $details['srcGmdate'] = gmdate("D, d M Y H:i:s", $lastModified); $details['cache'] = basename($this->cacheFileName); $lastModified = filemtime($this->cacheFileName); - $details['cache-gmdate'] = gmdate("D, d M Y H:i:s", $lastModified); + $details['cacheGmdate'] = gmdate("D, d M Y H:i:s", $lastModified); $details['width'] = $this->width; $details['height'] = $this->height; + $details['aspectRatio'] = round($this->width / $this->height, 3); return json_encode($details, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); } diff --git a/README.md b/README.md index 84532cd..bd40628 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,8 @@ Revision history v0.5.x (latest) +* Improving template for tests in `webroot/tests` when testing out #40. +* Adding testcase for #40. * Adding option `convolve` taking comma-separated list of 11 float-values, wraps and exposes `imageconvoluttion()`. #4 * Adding option `dpr, device-pixel-ratio` which defaults to 1. Set to 2 to get a twice as large image. Useful for Retina displays. Basically a shortcut to enlarge the image. * Adding utility `cache.bash` to ease gathering stats on cache usage. #21 diff --git a/webroot/img/issue40/source.jpg b/webroot/img/issue40/source.jpg new file mode 100644 index 0000000..42b9ea3 Binary files /dev/null and b/webroot/img/issue40/source.jpg differ diff --git a/webroot/test/test_issue40.php b/webroot/test/test_issue40.php new file mode 100644 index 0000000..75216c9 --- /dev/null +++ b/webroot/test/test_issue40.php @@ -0,0 +1,120 @@ + + + + Testing img for issue 40 - no ratio + + + + + + + +

Testing issue 40 - no ratio

+ + + + +

Images used in test

+ +

The following images are used for this test.

+ + +

+ + + (json) + (verbose) + +
+

+

+ +

+
+
+
+
+
+
+

Testcases used for each image

+ +

The following testcases are used for each image.

+ + +
+ + + + +

Applying testcase for each image

+ + +

. Using source image

+ +

+ + + (json) + (verbose) + +
+ +

+ +

+
+
+
+

Testcase :

+ +

+ + + (json) + (verbose) + +
+ +

+ +

+
+
+
+
+