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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user