1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-11 10:34:18 +02:00

* Cache now uses same file extension as original image #37.

* Can output image as json format using `json` #11.
This commit is contained in:
Mikael Roos
2014-11-21 22:20:30 +01:00
parent ccc59fbb3a
commit ba45f746bb
3 changed files with 75 additions and 7 deletions

View File

@@ -454,6 +454,15 @@ verbose("filters = " . print_r($filters, 1));
/**
* json - output the image as a JSON object with details on the image.
*/
$outputFormat = getDefined('json', 'json', null);
verbose("json = $outputFormat");
/**
* Display image if verbose mode
*/
@@ -464,6 +473,7 @@ if ($verbose) {
unset($query['v']);
unset($query['nocache']);
unset($query['nc']);
unset($query['json']);
$url1 = '?' . http_build_query($query);
echo <<<EOD
<a href=$url1><code>$url1</code></a><br>
@@ -509,6 +519,9 @@ $img->setVerbose($verbose)
'blur' => $blur,
'rotateAfter' => $rotateAfter,
'autoRotate' => $autoRotate,
// Output format
'outputFormat' => $outputFormat,
)
)
->loadImageDetails()