mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-05 23:57:30 +02:00
Check if constants exists. Fix #42
This commit is contained in:
@@ -1735,7 +1735,12 @@ class CImage
|
|||||||
$details['height'] = $this->height;
|
$details['height'] = $this->height;
|
||||||
$details['aspectRatio'] = round($this->width / $this->height, 3);
|
$details['aspectRatio'] = round($this->width / $this->height, 3);
|
||||||
|
|
||||||
return json_encode($details, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
$options = null;
|
||||||
|
if (defined("JSON_PRETTY_PRINT") && defined("JSON_UNESCAPED_SLASHES")) {
|
||||||
|
$options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES;
|
||||||
|
}
|
||||||
|
|
||||||
|
return json_encode($details, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user